text box visible = true but its not appears when i click "play". i am 0 sure for the script that i wrote
script.Parent.Parent.StarterGui.ScreenGui.TextBox.Visible = true
thats a part of my game so don't say "you only click visible instead script" when script work, textbox is not appear and im checking properties for if text box visible. when i see textbox's visible = true and its not in my screen i try again try again try again and try again for make it work. (of course, that doesn't work) can someone explain it
`script.Parent.Parent.StarterGui.ScreenGui.TextBox.Visible` `=` `true`
so first of all you should make a new script in that ScreenGui it would make the code a lot less messy. Make sure its player gui too here's what it would look like if you did NOT make a new script in the screengui:
script.Parent.Parent.PlayerGui:WaitForChild("ScreenGui"):WaitForChild("TextBox").Visible = true
if you do make a script in the new screen gui which you should it would look like this:
script.Parent:WaitForChild("TextBox").Visible = true
The reason why it won't work is because you're going into the StarterGui service. The startergui service clones itself into the player, so any changes you do in there won't replicate to the other players.
local Player = game:GetService("Players").LocalPlayer --We get the player in this variable. Player:WaitForChild("PlayerGui").ScreenGui.TextBox.Visible = true --We find all of the GUIs in the player, which is located in the PlayerGui, and then find the specific GUI we want, and then change the visible property of the TextBox inside the ScreenGui to true.