This simple script:
script.Parent.Close.MouseButton1Click:Connect(function()
script.Parent.Parent.Enabled = false
end)
That used to close script won't work, no output.
Type: LocalScript
This simple script:
script.Parent.Close.MouseButton1Click:Connect(function()
script.Parent.Parent.Enabled = false
end)
That used to close script won't work, no output.
Type: LocalScript
You need to use PlayerGui, it is because player (client) only sees his own playergui, which is client. But server sees the StarterGui. This is also a new update, so teach other people who doesn't know!
script.Parent.Close.MouseButton1Click:Connect(function()
game.Players.LocalPlayer:WaitForChild("PlayerGui").ScreenGui.Frame.Enabled = false
end)
Also, locate the thing you want to disable in line 2, it was a guess
btw i just change it to server script and works :P, here free rep
DeceptiveCaster on the comments explained why it doesn't work. Disabling it only means you can't interact with it. Instead do this:
Parent the the stuff in the screen gui to a Frame that is whole screen wide and BackgroundTransparency 1 so it is invisible.
edit the local script to this:
script.Parent.Close.MouseButton1Click:Connect(function()
script.Parent.Parent.Visible = false
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
Enabled just means you're able to interact with the GUI. It does not close the GUI, but it disables user interaction with the GUI. What you're looking for is this property as well as the Visible property.