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
 

Re: Need a script.. Dunno how

Previous Thread :: Next Thread 
thelolguy301 is not online. thelolguy301
Joined: 27 Sep 2011
Total Posts: 2997
02 Apr 2015 12:05 PM
So I need a script in a part that runs through all players, and everytime a player is closer than 5 studs away, it returns true. It would return true twice if two players at the same time came close enough.. How do I do this with .magnitude. :/
Report Abuse
thelolguy301 is not online. thelolguy301
Joined: 27 Sep 2011
Total Posts: 2997
02 Apr 2015 02:27 PM
Bump
Report Abuse
ultragumball is not online. ultragumball
Joined: 18 Mar 2011
Total Posts: 521
02 Apr 2015 03:16 PM
Just an attempt, but...

local p = game.Players:GetPlayers()

local currentp = nil

for i = 1, #p do

currentp = p[i]
otherp = #p - 1

for i = 1, otherp do
if currentp.Character.Torso.magnitude - otherp.Character.Torso.magnitude < 5 then
--the thing you want to put in here
end
end

It probably is very wrong, but I did it quite quickly.
Report Abuse
thelolguy301 is not online. thelolguy301
Joined: 27 Sep 2011
Total Posts: 2997
02 Apr 2015 07:01 PM
Bump
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