Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Workspace.Main:43: bad argument #2 to '?' (Vector3 expected, got nil) Help?

Asked by 10 years ago

I have another problem with this script... Heres SOME of the script Problem is in LINE 6!

01local TeleportLocation = Vector3.new(248.01, 74.84, 162.94)
02 
03PlayersInGame = game.Players:GetChildren()
04for i = 1, #PlayersInGame do
05    print("Debug 9")
06PlayersInGame[i].Character:MoveTo(TeleportLocation + Position)
07 
08 
09 
10local Players = game.Players:GetPlayers()
11local Object = 'Blade' --Change it to ur Weapon
12print("Debug 10")
13 
14PickedPlayer = Players[math.random(1, #Players)]
15print("Debug 11")
View all 24 lines...
0
Please place code in Code block, thank you. M39a9am3R 3210 — 10y
0
Trying ;D aaron8888 3 — 10y
0
There aaron8888 3 — 10y
0
Did you define position? GoldenPhysics 474 — 10y

1 answer

Log in to vote
0
Answered by 10 years ago

Position isn't defined so thats why it returned nil

Make Position a variable at least or if you mean the character's current position just use

1PlayersInGame[i].Character:MoveTo(TeleportLocation + PlayersInGame[i].Character.Torso.Position)
0
This helped that thing, BUT now LINE 10 is underlined? aaron8888 3 — 10y
0
Nevermind, i forgot to put ")" at the end of the answer aaron8888 3 — 10y
Ad

Answer this question