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

How does :LoadCharacter work?

function onTouched()
	:LoadCharacter()
end

script.Parent.Touched:connect(onTouched)

1 answer

✓ Accepted answer

Load character works when called on a Player like below;

game.Players.M39a9am3R:LoadCharacter()

It will load your character, it is basically a respawn, or a reset without killing your character.


function onTouched(part) --Part hit it.
if part ~= nil then --Does it exist?
if part.Parent:FindFirstChild("Humanoid") then --Is it human?
local name = part.Parent.Name --Get their name.
if game.Players:FindFirstChild(name) then --Is there a player with that name?
    game.Players:FindFirstChild(name):LoadCharacter()
end
end
end
end

script.Parent.Touched:connect(onTouched)

4 comments

0

ok, so I am making an (for example) and instead of killing the player with lava, i use LoadCharacter. How could I get it ot do onTouched?

0

Can you edit your original post with what you have tried?

0

edtitted

0

thanks

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