Okay I am experimenting with GUI's and I'm trying to hide or destroy a GUI button when clicked. I've made this code but it doesn't work.
1 | function onClick() |
2 | game.Players.LocalPlayer.PlayerGui.ScreenGui:Destroy() |
3 | end |
4 |
5 | LocalScript.Parent.MouseButton 1 Click:connect(onClick) |
That's because it's not "LocalScript" even if it is in a local script, It's still just "script"
1 | function onClick() |
2 | script.Parent:remove() |
3 | end |
4 | script.Parent.MouseButton 1 Click:connect(onClick) |
It is not a Even if it is a local script you still use script. Also, try using regular scripts.