Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to add this to my script?

Asked by 9 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

So, I have an Obby For Admin game, and I added a security script.

I have a clone of the obby in ServerStorage.

So when someone wins admin and deletes the game with a code, the script clones the obby in ServerStorage and puts it into workspace.

I have that all set, but how am I supposed to regenerate the players?

0
"deletes the game with a code"? If this is something that the adminscript you have allows you to do, you should just find the "delete" code in the admin script and remove it. chess123mate 5873 — 9y

2 answers

Log in to vote
0
Answered by 9 years ago

The Player class has a method called :LoadCharacter(). You can use that method to effectively respawn a character without killing the character itself. Like so:

local Plyr = game.Players.TurboFusion
Plyr:LoadCharacter()

Hope this helped!

0
You also forgot to mention you can't use the Method within a 'LocalScript'. TheeDeathCaster 2368 — 9y
Ad
Log in to vote
0
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
9 years ago

Turbo started the explanation, but forgot the rest. If you want to respawn all players, use pairs, as well as the GetPlayers method.

for i,v in pairs(game.Players:GetPlayers()) do
    v:LoadCharacter()
end

Answer this question