How do I record deaths from people dying in the void?

I am making a game which has a mechanic similar to the one found in carry people simulator where you can grab people and then throw them off the map for kills.

I’m having trouble with finding out how to record when you throw someone else off the map and gain kills from it.
I have leaderstats and all that, this is the only thing I am confused about.

1 Like

How about you detect when the players state changes to freefall and then have the camera lookAt the players root cframe

The player dies in the void at a default height of -500 (unless you changed it). The easiest way to do this would be to increment a value on the leaderstats whenever the PrimaryPart of the player’s character reaches that height or lower.

3 Likes

I’ll try that for how I’ll make it check for deaths in the void.
Still though, how do I make it remember who actually threw you in the void? Cause obviously you could just jump in there without anyone actually throwing you in.

Whenever someone is thrown or otherwise picked up, you can add a tag to that player which stores the name of the person who threw them. That way when they die/fall in the void, you can check the tag to see who (if anyone) should be credited with the kill!

I think this post might also be helpful :slight_smile:

3 Likes

I haven’t tested this yet, but how about you make a block, that kills the player when touched, recording the info, kinda like making your own void.

2 Likes

Get a variable and record the last dude who carry the person who fell off the map. And after he fell, you can detect his hp is 0. So basically use an if statement and if the guy hp is 0 then just increase the kills value for the last player who carried him.(aka the variable)

Edit: Set reset to false too btw.

1 Like
local function OnThrow(Char,CharKiller)
local recivedPoint = false
      Char.Torso:GetPropertyChangedSignal("Velocity"):Connect(function()
             if Torso.Position.Y >= -240 then
                    if Char.Humanoid.Health <= 0 and recivedPoint == false then
                          recivedPoint = true
                          -- add points to the Char killer
                    else
                           if Char.Humanoid:GetState() == Enum.HumanoidStateType.Landed then
                                 recivedPoint = false
                                 return
                           end
                    end
             end
      end)
end
2 Likes

Can you make a new thread of this instead?

I think another method is to use Instance | Documentation - Roblox Creator Hub on a value object inside the character. When the character dies and the model gets destroyed this event should run and hence possible for the person who threw the character to get rewarded.

Like a new post?