Hello Scripting Helpers!
I just made a teleport script what uses GetPlayerFromCharacter. I'm not quite sure if I'm using it right. Here is the script (With annotation):-
function teleportcontestants() -- Function
for _,TeleportContestants in pairs(game.Players:GetPlayerFromCharacter(character)) do -- Gets the characters model
character.CFrame = workspace.MyPart -- Teleports the character to the part.
end
end
Here is the script (With no annotation):-
function teleportcontestants()
for _,TeleportContestants in pairs(game.Players:GetPlayerFromCharacter(character)) do
character.CFrame = workspace.MyPart
end
end
I was just looking at http://wiki.roblox.com/index.php?title=API:Class/Players/GetPlayerFromCharacter to try and figure the GetPlayerFromCharacter.
It errors on line 2 and says bad argument #1 to 'pairs' (table expected, got nil).
It's the first time I'm using CFrame properly.
Any help?
Thanks! Nathan.

1 comment
Works great! Thanks!