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

Button lets me click once but wont after the second?

When I click a part in the workspace it is supposed to show a frame but it works one time then when you close the frame and try to click the part again it wont show here is the code to the part that shows the frame (Script)

local cd = script.Parent.ClickDetector

cd.MouseClick:Connect(function(click)
	local player = game.Players:FindFirstChild(click.Name)
	player.PlayerGui.Heist1GUI.Code.Visible = true
end)

Here is the code that hides the frame (LocalScript)

local frame = script.Parent
local ex = script.Parent.Exit

ex.MouseButton1Click:Connect(function(click)
	frame.Visible = false
end)

1 answer

Making it visible with a server sided script and using a local script to make it invisible would be the problem. The server still thinks that the frame is visible. To fix this, put the code in the same type of script. In your case, it would be easiest to make them both server sided, although I don't recommend using regular scripts for UI.

1 comment

0

^ You can also just add a line to make the frame invisible server side right before making it visible

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