Hello everyone, I'd like to know why my script works but one time:
function touch(hit) if game.Players:findFirstChild(hit.Parent.Name) ~= nil then local player = game.Players[hit.Parent.Name] if player.PlayerGui:findFirstChild("Info") == nil then local gui = script.Parent.Info:Clone() gui.Parent = player.PlayerGui player.PlayerGui.Info.Title.BackgroundTransparency = 0.95 player.PlayerGui.Info.Title.TextTransparency = 0.8 wait(0.1) player.PlayerGui.Info.Title.BackgroundTransparency = 0.75 player.PlayerGui.Info.Title.TextTransparency = 0.6 wait(0.1) player.PlayerGui.Info.Title.BackgroundTransparency = 0.65 player.PlayerGui.Info.Title.TextTransparency = 0.4 wait(0.1) player.PlayerGui.Info.Title.BackgroundTransparency = 0.55 player.PlayerGui.Info.Title.TextTransparency = 0.2 wait(0.1) player.PlayerGui.Info.Title.BackgroundTransparency = 0.5 player.PlayerGui.Info.Title.TextTransparency = 0 player.PlayerGui.Info.Title.Visible = true wait(5) repeat wait() until (player.Character.LowerTorso.Position - script.Parent.Position).magnitude > 5 player.PlayerGui.Info.Title.BackgroundTransparency = 0.65 player.PlayerGui.Info.Title.TextTransparency = 0.2 wait(0.1) player.PlayerGui.Info.Title.BackgroundTransparency = 0.75 player.PlayerGui.Info.Title.TextTransparency = 0.4 wait(0.1) player.PlayerGui.Info.Title.BackgroundTransparency = 0.85 player.PlayerGui.Info.Title.TextTransparency = 0.6 wait(0.1) player.PlayerGui.Info.Title.BackgroundTransparency = 0.95 player.PlayerGui.Info.Title.TextTransparency = 0.8 wait(0.1) player.PlayerGui.Info.Title.BackgroundTransparency = 1 player.PlayerGui.Info.Title.TextTransparency = 1 player.PlayerGui.Info.Title.Visible = false end end end script.Parent.Touched:connect(touch)
Thank you in advance !