generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Distance Check

Previous Thread :: Next Thread 
Gaspercino1423 is not online. Gaspercino1423
Joined: 06 Jun 2014
Total Posts: 1
26 Dec 2016 04:09 AM
Hi i maked that scritp
local player = game.Players.LocalPlayer



function onPlayer(player)
while true do
wait()
local torso = player.Character.Torso
if torso then
local distance = (torso.Position - script.Parent.Position).magnitude
if distance < 20 then
player.PlayerGui.ScreenGui.ShopFrame.Visible = true
else
player.PlayerGui.ScreenGui.ShopFrame.Visible = false
end
end
end
end

game.Players.PlayerAdded:connect(onPlayer)




works prfect in roblox studio but when i go to server doesnt want to work someone help pls
Report Abuse
YamamotoTaka is not online. YamamotoTaka
Joined: 28 Sep 2012
Total Posts: 1383
26 Dec 2016 05:17 AM
game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)

torso = character.Torso
-- stuff

end)
end)


Try this.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image