Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.41 KB | None | 0 0
  1. function onPlayer(player)
  2.     while true do
  3.         wait()
  4.         local torso = player.Character:WaitForChild("Torso")
  5.         if torso then
  6.         local distance = (torso.Position - script.Parent.Position).magnitude
  7.             if distance < 10 then
  8.             script.Parent.Transparency=0
  9.         else
  10.             script.Parent.Transparency=1
  11.         end
  12.     end
  13.     end
  14. end
  15.  
  16. game.Players.PlayerAdded:connect(onPlayer)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement