I made button brick, when you click on it, it shows a Selection Box and a GUI. But for some reason it doesn't work. This is my script;
local gui = script.Gui:clone() function onClicked(Part) if not Player.PlayerGui:FindFirstChild("Gui") then gui.Parent = Player.PlayerGui gui.LocalScript.Disabled = false end script.Parent.SelectionBox.Visible = true end end script.Parent.ClickDetector.MouseClick:connect(onClicked)
What went wrong in this?
local gui = script.Gui:clone() script.Parent.ClickDetector.MouseClick:connect(function(Player) if not Player.PlayerGui:FindFirstChild("Gui") then gui.Parent = Player.PlayerGui gui.LocalScript.Disabled = false end script.Parent.SelectionBox.Visible = true end)
I don't think you were getting the player value... Try this.