Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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")

4 comments

0

Please place code in Code block, thank you.

0

Trying ;D

0

There

0

Did you define position?

1 answer

✓ Accepted answer

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)

2 comments

0

This helped that thing, BUT now LINE 10 is underlined?

0

Nevermind, i forgot to put ")" at the end of the answer

This discussion is preserved as it was. New answers, comments, and votes are closed.