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

How do I access game.Players.LocalPlayer.Character in a normal script?

I'm trying to create a disaster script that will teleport the players to the lobby on death and when the round has started I want them to teleport to the baseplate. Can anybody show me how to access "Character" within the confinements of a normal script?

1 answer

✓ Accepted answer

I mostly use a for loop for this, to get all players as individual objects.

You can do the following to acces all individual players inside of the game.

for _,player in pairs(game.Players:GetPlayers()) do
	local Character = player.Character
	--do stuff for each character
end

3 comments

0

btw, for death to lobby, i suggest you just put a spawn location inside of the lobby to make your life easier ^^

0

Yeah.Thanks for your help! I won't accept this answer until I have tried it.

0

Thanks! It works!!!!

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