#Textbox permission
1 messages · Page 1 of 1 (latest)
Is it a local script?
or server script?
Local scripts can detect all events and modify everting about a Ui
Server Scripts can only do some
But in almost ever case u have to Manipulate Ui using local scripts, bacause its no laggy
Imagine u click a button to open inventory and have a delay of 122 ms(it look low, and is it, but in quick actions, like open a inventory, it really matter)
will the text still display to everyone if changed to localscript?
ohhh
The Surface Gui is child of a part right?
but the real Ui, where is it?
Thats the problem
We have 2 problems btw
One is the fact that is a script, not a local script
scripts cannot detect user input in most cases
The second problem is the fact that Guis in workspace cannot detect user input too
To a Ui be able to detect User Input, u have to put in PlayerGui
would it still display to every player
** You are now Level 3! **
lemme show a solution
As in if i changed the text since the script is meant to make it so only i can edit the text
1 was a placeholder/test
yes, but if u want to have the same data, u have to use remote events
os smth
but
make it:
Insine Of StarterGui put your SurfaceGui
Dont put in the part
Otherwise it wont detect user input
how would it go on the part then
When a Gui is insige StarterGui, it'll be copied onto PlayerGui when the game starter
SurfaceGui have a prop called Adornee
Click in the Adornee, and chosse the instance u would like to show the SurfaceGui
ohhh
And after this your part will have a SurfaceGui with All user Input working
But dont forget to change the script to a local script
the local script have to be in the surface gui to work, otherwise wont
See some videos or smth about the diference between local and server scripts to not make any confusion while scripting
so not the text label?
textbox*
u can put in the textbox too
local script work in local, ie work in the computer of the player, to know what player it should run it have to be parented as a descentend of a Player
this isnt working is it the placement or script
When u click Start, all the content of StarterGui will be copied to PlayerGui, PlayerGui is a child of a Player, so anywhere u put the local script(while is in SurfaceGui or smth) it work
Should u show the entire script?
Thats the entire script
Ok
Thatss the problem
U creating a function
But ur not saying to the textbox what to do
u have to do
TextBox.Focused:Connect(functionhere)
Making this like u say to roblox: Connect this function to the action of Focused of this TextBox
Im a bit confused
which part u get confused?
here and below
In roblox
function is a part of code that do smth
But a function is not do anything if wont be called
local function printHello()
print("Hello world")
end
printHello() -- will print Hello World
in your code, u making this function, but not calling it anywhere
TextBox.Focused:Connect(functionhere)
** You are now Level 6! **
U making a function and not calling it
To roblox the function dont have nothing to do with the TextBox
shouldnt 'onFocused' be calling it wehn its focused
U have to say, or code, to roblox to connect these to
It is though
A name of a function dont get automatically called when the event happen
the variable score is the textbox and it tells the textbox to hcnage the texteditable bool right?
sorry
yes
okay
but the function it isnt be called
So dont make anything
cause the function isnt be calling
how would i call it when the textbox is focused on then
yes
connect is the act to automatically call a functin ever time that thats event happen
TextBox.Focused:Connect(NameOfTheFunction)
Thats what this line do
u have to explicty say to roblox: "Connext this function to this event on that instance"
Yes
thank you ill test that
IT works!! thanks
I highly recommend to You seeing videos to: How roblox connect events to function and How roblox work in client-server scripts to help u learn more!
Thanks for the tips and help
I tested it and only i can see the text input
okayy i just taught myself remote events and scripts nvm
** You are now Level 4! **