|
Script:
local spawns = workspace.Lobby.Spawns
game.Players.PlayerAdded:connect(function(plr)
for i,v in pairs(spawns:GetChildren()) do
plr:MoveTo(CFrame.new(spawns[i].Position))
end
end)
It will not move the player to the spawn.
|
|
WrathsongJoin Date: 2012-07-05 Post Count: 22393 |
game.Players.PlayerAdded:connect(function(plr)
player.Character:connect(function(char)
for i,v in pairs(spawns:GetChildren()) do
char:MoveTo(CFrame.new(spawns[i].Position))
end
end)
end)
Ever wanted to learn how to script? Check out my YouTube channel: youtube.com/austintheslayer Want to see me code in action? Follow me on twitch: twitch.tv/austinrblx |
|
WrathsongJoin Date: 2012-07-05 Post Count: 22393 |
In other words, you can't use MoveTo on the player, but their Character.
Ever wanted to learn how to script? Check out my YouTube channel: youtube.com/austintheslayer Want to see me code in action? Follow me on twitch: twitch.tv/austinrblx |
|
|
Doesn't work.
Error: 13:54:41.510 - Workspace.PlayerJoin:4: attempt to index field 'Character' (a nil value)
|
|
|
game.Players.PlayerAdded:connect(function(plr)
player.CharacterAdded:connect(function(char)
for i,v in pairs(spawns:GetChildren()) do
char:MoveTo(CFrame.new(spawns[i].Position))
end
end)
end) |
|
|
|
Are you blind?
"player.CharacterAdded" |
|
ryanzlionJoin Date: 2012-05-27 Post Count: 65 |
It's different. He changed .Character to .CharacterAdded. This will run when the character added rather than it not running at all. |
|
|
Either way it doesn't work.
|
|
|
doesn't moveto need a vector3 too?
|
|
|
WrathsongJoin Date: 2012-07-05 Post Count: 22393 |
"player.Character"
to player.CharacterAdded, oops
Ever wanted to learn how to script? Check out my YouTube channel: youtube.com/austintheslayer Want to see me code in action? Follow me on twitch: twitch.tv/austinrblx |
|
|
That doesn't work either.
|
|
|
because moveto needs a vector3 argument.
|
|
|
local lobby = workspace:WaitForChild('Lobby')
local spawns = lobby.Spawns
game.Players.PlayerAdded:connect(function(plr)
plr.CharacterAdded:connect(function(char)
for i,v in pairs(spawns:GetChildren()) do
char:MoveTo(v.Position)
end
end)
end)
|
|
|
|
then something else is your problem
|
|
|
That's ### only script in ## game right now. |
|
|
|
|
add prints after everything and tell me what it doesnt print
|
|
|
|
even the part in the for loop?
|
|
AxonMegaJoin Date: 2014-08-29 Post Count: 2403 |
Take out the CFrame.new(). |
|
ryanzlionJoin Date: 2012-05-27 Post Count: 65 |
Axon did you even read this whole post? |
|