I bet it's a really simple problem but I can't find it. I want it so if you touch the Door a gui appears.
script.Parent.Touched:connect(function(hit) local Guy = game.Players:GetPlayerFromCharacter(script.Parent) if Guy then if Guy.PlayerGui.Riddles:FindFirstChild("Riddle") then Guy.PlayerGui.Riddles:FindFirstChild("Riddle"):Destroy() local Riddle = script.Parent.Riddle:clone() Riddle.Parent = Guy.PlayerGui.Riddles end end end)
script.Parent.Touched:connect(function(hit) if game.Players:FindFirstChild(hit.Parent.Name) ~= nil then local guy = game.Players:FindFirstChild(hit.Parent.Name) if Guy.PlayerGui.Riddles:FindFirstChild("Riddle") then Guy.PlayerGui.Riddles:FindFirstChild("Riddle"):Destroy() local Riddle = script.Parent.Riddle:clone() Riddle.Parent = Guy.PlayerGui.Riddles end end end)