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
 

magnitude problem, kind of

Previous Thread :: Next Thread 
Kobertum is not online. Kobertum
Joined: 04 Oct 2013
Total Posts: 2335
16 Jun 2015 03:17 AM
1 -- local door = script.Parent
2 -- local distance = 5
3 --
4 -- while true do
5 -- for _, player in pairs(game.Players:GetPlayers()) do
6 -- mag = (player.Character.Torso.Position - door.Position).magnitude
7 --
8 --
9 -- if mag <= 15 then
10 -- door.Position = Vector3.new(0, 50, 0)
11 -- end
12 -- end
13 -- end

I cannot tell you what the Output says due to everytime I attempt to play solo or start a server, it crashes,

Roblox Developer Console says;
01:13:57 -- Script 'Workspace.Union.DistanceMeter', Line 5
which is this line;
for _, player in pairs(game.Players:GetPlayers()) do

Help please?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
16 Jun 2015 03:21 AM
Yield in that while loop, so just add a wait(blah) under line 4 or above line 13
Report Abuse
Kobertum is not online. Kobertum
Joined: 04 Oct 2013
Total Posts: 2335
16 Jun 2015 03:22 AM
thanks champ

i appreciate it tons,
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