✓ Accepted answer
Dude you got to let your script breath a little. Your computer can run the script in a second, but the roblox servers can't run it as fast as your computer can. So I highly recommend that you add some waits.
script.Parent.MouseButton1Click:connect(function()
if script.Parent.Parent.Box.Visible == false then
script.Parent.Text = "Close"
wait(0.1)
script.Parent.Parent.Box.Visible = true
wait(0.1)
script.Parent.Text = "Settings"
wait(0.1)
script.Parent.Parent.Box.Visible = false
end
end)
Also your script literally makes no scence. You want your script to making a text say close. Then you want a box to be visible. Then you want the same text to say settings then you want the same box to be invisible? If that is how you want it to work, then I guess use that, but this script would make more scence.
script.Parent.MouseButton1Click:connect(function()
if script.Parent.Parent.Box.Visible == false then
script.Parent.Text = "Close"
wait(0.1)
script.Parent.Parent.Box.Visible = true
elseif script.Parent.Parent.Box.Visible == true then
script.Parent.Text = "Settings"
wait(0.1)
script.Parent.Parent.Box.Visible = false
end
end)
3 comments
Is this a normal/server script ?
no
give me a screenshot of the objects in startergui and ill solve it