function onTouched()
:LoadCharacter()
end
script.Parent.Touched:connect(onTouched)
✓ ANSWER ACCEPTED
How does :LoadCharacter work?
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)
This discussion is preserved as it was. New answers, comments, and votes are closed.

4 comments
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?
Can you edit your original post with what you have tried?
edtitted
thanks