I'm trying to make this screen gui show when they click a block. This is what I've tried:
GUI = game.ReplicatedStorage.HighGunStore1Frame game.Players.LocalPlayer:GetChildren() Event = game.ReplicatedStorage.Events.IllegalGunStore script.Parent.MouseClick:Connect(function(player) Event:FireClient() game.Players.LocalPlayer.PlayerGui.LocalScript.Disabled = false end end)
The local script that it is changing to not disabled has this code:
script.HighGunStoreFrame.Visible = true
Instead try this.
Make a Part in workspace with a click detector inside it
Put a script in the click detector
Put the gui you want into the part and put this code into the script
Change GuiNameHere to the guis name
local Debounce = false script.Parent.MouseClick:Connect(function(PlayerWhoClicked) if Debounce = false then Debounce = true local NewGui script.Parent.Parent.GuiNameHere:Clone() NewGui.Parent = PlayerWhoClicked.PlayerGui else for i, v in pairs(PlayerWhoClicked.PlayerGui:GetChildren()) do if v.Name == "GuiNameHere" then v:Destroy() end end end end)
Please accept this answer if this helped!