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!

local TeleportLocation = Vector3.new(248.01, 74.84, 162.94)

PlayersInGame = game.Players:GetChildren()
for i = 1, #PlayersInGame do
    print("Debug 9")
PlayersInGame[i].Character:MoveTo(TeleportLocation + Position)



local Players = game.Players:GetPlayers()
local Object = 'Blade' --Change it to ur Weapon
print("Debug 10")

PickedPlayer = Players[math.random(1, #Players)]
print("Debug 11")
for i, v in pairs (game.Lighting:GetChildren()) do
if v.Name == Object then
v:clone().Parent = PickedPlayer.Backpack
print("Debug 12")
end
end
h = Instance.new('Message')
h.Text = 'Game in Progress [2 Minutes]'
print("Debug 13")
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

PlayersInGame[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