So, in my game I'm trying to make it so when you click with this item, you get a gui that pops up with a few buttons on it. The script I wrote below has an error indexing nil with "playergui".
script.Parent.Activated:Connect(function() local ItemGui = script.Parent.AlertGui ItemGui:Clone().Parent = game.Players.LocalPlayer.PlayerGui end)
local tool=script.Parent local player,debounce=game.Players[tool.Equipped:Wait() and tool.Parent.Name],false local ItemGui,gui=tool.AlertGui,nil tool.Activated:Connect(function() if debounce then return end debounce=true gui=ItemGui:Clone() gui.Parent=player.PlayerGui end) tool.Unequipped:Connect(function() gui:Destroy() debounce=false end)