|
| 23 Nov 2011 01:26 PM |
This script was for a figure I made to follow the nearest player. It said there was a problem around the 18th line or so. "Attempt to compare number to nil" What is wrong with it? I put this script into the Humanoid.
while wait() do Minimum=nil Players=game.Players:GetPlayers() for i=1,#Players do if Minimum==nil then if Players[i].Character then if Players[i].Character.Torso then if Players[i].Name=="bunnybunn263" then else if Players[i]:IsFriendsWith(60041) then else Minimum=Players[i]:DistanceFromCharacter(script.Parent.Parent.Torso.Position) Target=Players[i].Character.Torso end end end end elseif Players[i]:DistanceFromCharacter(script.Parent.Parent.Torso.Position) < Minumum then if Players[i].Character then if Players[i].Character.Torso then if Players[i].Name=="bunnybunn263" then else if Players[i]:IsFriendsWith(60041) then else Minimum=Players[i]:DistanceFromCharacter(script.Parent.Parent.Torso.Position) Target=Players[i].Character.Torso end end end end end end if Target then if Target==nil then else script.Parent:MoveTo(Target.Position,Target) end end end
|
|
|
| Report Abuse |
|
|
tdog158
|
  |
| Joined: 08 Jul 2008 |
| Total Posts: 5413 |
|
|
| 23 Nov 2011 01:28 PM |
| You misspelled 'Minimum' in line 18. |
|
|
| Report Abuse |
|
|
|
| 23 Nov 2011 01:28 PM |
This was the line something was wrong with:
elseif Players[i]:DistanceFromCharacter(script.Parent.Parent.Torso.Position) < Minumum then
|
|
|
| Report Abuse |
|
|
tdog158
|
  |
| Joined: 08 Jul 2008 |
| Total Posts: 5413 |
|
|
| 23 Nov 2011 01:29 PM |
| Correct, and you spelled minimum wrong. |
|
|
| Report Abuse |
|
|
|
| 23 Nov 2011 01:29 PM |
| Oops. I thought I spell-checked everything. :o |
|
|
| Report Abuse |
|
|