This might be impossible but I am wondering if you can check if someone clicked reset in the menu. Thanks, KIheros
How to check if reset was clicked?
1 answer
This assumes that you have made all of the scripts in your game
If you didn't kill them, it's probably not unfair to say that they might have killed themselves. When Humanoid.Died fires, check if one of your scripts killed the humanoid (You'll need to set up a broadcast or BoolValue or something to tell scripts that we're looking at murder). If it wasn't one of your scripts, then they reset.
As an example, you can have a suicide watch script like this
game.Players.PlayerAdded:connect(function(p)
p.CharacterAdded:connect(function(c)
local hum = c:WaitForChild("Humanoid");
local murder = Instance.new("BoolValue");
murder.Name = "Murder";
murder.Value = false;
murder.Parent = hum;
-- local torso = c:WaitForChild("Torso");
hum.Died:wait();
if murder.Value then
-- Killed by a script
else
-- Suicide
end;
end);
end);
And then in a killing script you can write this
if humanoid then
-- Ayy let's get 'im
humanoid.Murder.Value = true;
humanoid.Parent:BreakJoints();
end
There is one more possibility, which is that the Player jumped off the edge. To catch that, try this:
(Assumes that you've got a Torso predefined from the CharacterAdded with `local torso = c:WaitForChild("Torso"))
else -- If it's not murder
if torso.Position.Y < workspace.FallenPartsDestroyHeight then
-- Also not murder, unless they were pushed, but not a reset.
else
-- Reset.
end;
end;
5 comments
I removed the edit I am so happy you said this!
Tada
Clever thinking, eLunate. I'm voting you up.
I did make all the scripts in my game but I am wondering how to check as I use another object while the player is destroyed so I can reset the object when I click reset. but maybe I should just not even have reset work and have an extra button or something I'll still accept cause its a great answer anyway!
I got on my computer and added some code, and revised the answer.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
You could use the Humanoid.Died event, but there is no way of checking whether the button has been clicked, no.