✓ Accepted answer
Hey Aceros,
I've been working on what you've asked about for like the past 30 minutes or so and I already knew that :LoadCharacter() method would be the correct method but, because of my inexperience of it's usage, I wasn't quiet sure so, I made a game that you can take a copy of that I will mention later in the answer and I am also gonna provide you with an explanation of how :LoadCharacter() works. Below is a personal example.
####Personal Example:
local part = script.Parent;
local players = game:GetService("Players");
local debounce = false;
part.Touched:Connect(function(obj)
local hum = obj.Parent:FindFirstChild("Humanoid");
if hum and debounce == false then
debounce = true;
print("Reloading Character..");
local char = obj.Parent;
local plr = players:GetPlayerFromCharacter(char);
local shirt = char:WaitForChild("Shirt"):Clone();
local pants = char:WaitForChild("Pants"):Clone();
plr:LoadCharacter();
local new_char = plr.Character;
shirt.Parent = new_char;
pants.Parent = new_char;
wait(0.5)
debounce = false;
end
end)
###Anyways, here is my game. In there you will be able to see a blue brick and a red brick and if you touch the blue one, it will reload you and if you touch the red one, it will kill you. The game is un-copylocked so you can take a copy and look at the code I did and use it as an example! Don't copy others people's code. I also did data storage for the game and leaderstats to record your death so you can have a more relative point for what you need help with.
##Well, I hope I helped in one way or another and have a great day/night.
~~ KingLoneCat
3 comments
Why are you using Destroy() when you could be using BreakJoints() or maybe just setting the humanoid's health to 0? It might work, but I'm too lazy to test it lol
That'd have the same effect; just killing the humanoid and then adding a wipeout
LoadCharacter function of Player. http://wiki.roblox.com/index.php?title=API:Class/Player/LoadCharacter