Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onPlayer(player)
- while true do
- wait()
- local torso = player.Character:WaitForChild("Torso")
- if torso then
- local distance = (torso.Position - script.Parent.Position).magnitude
- if distance < 10 then
- script.Parent.Transparency=0
- else
- script.Parent.Transparency=1
- end
- end
- end
- end
- game.Players.PlayerAdded:connect(onPlayer)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement