Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I make a text button instantly become visible, upon visiblity being checked to true?

In my game I need a button to become visible once a player touches a brick. The script i'm using does set the text button's visibility to true however, I don't actually see it on screen until I reset or die. Is there anyway to have the text button instantly appear on screen once its visibility is set to true?

Script-

Brick = script.Parent
Brick.Touched:connect(function()
	game.StarterGui.GUI.TextButton.Visible=true
	
end)

1 answer

✓ Accepted answer

TheFirstPhire, its because your using StarterGui, so you would need to reset to see the change, so instead of using StarterGui you could use PlayerGui which is the guis in the player like this:

Brick = workspace.Part
local player = game.Players.LocalPlayer -- accessing the player
Brick.Touched:connect(function()
    player.PlayerGui.GUI.TextButton.Visible = true -- playergui instead of startergui

end)

also follow incapaz comment

3 comments

0

LocalScripts do not run in Workspace. Place the script in PlayerGui and make Brick refer to the location of the brick in workspace.

0

ik i realized it from a comment lol

0

Thanks for the help, Its working correctly now.

This discussion is preserved as it was. New answers, comments, and votes are closed.