I know I can put a part where I have the fallenpartsdestroyheight set to, but is there a function or something that shows if a player has fallen out of the world?
You should put a block right where blocks are destroyed and enlarge it so it cover a lot of area. Then, add ontouch scripts inside the block. Make sure to anchor and turn off can collide on the block. Here is the script I would use:
1 | script.Parent.Touched:Connect( function (hit) |
2 | local hum = hit.Parent:FindFirstChild( "Humanoid" ) |
3 | if hum then |
4 | print (hit.Parent.Name .. " has fell out of the world." ) |
5 | end |
6 | end ) |
You can connect the ChildRemoved
event to the player's character and compare if the HRP's Y pos is less than the base's y pos:
01 | game.Players.PlayerAdded:Connect( function (player) |
02 | player.CharacterAdded:Connect( function (character) |
03 | local HRP = character:FindFirstChild( "HumanoidRootPart" ) |
04 | character.ChildRemoved:Connect( function (childRemoved) |
05 | if childRemoved = = HRP then |
06 | local YValue = HRP.Position.Y |
07 | if YValue < workspace.Base.Position.Y then |
08 | print (player, "fell out of the world" ) |
09 | end |
10 | end |
11 | end ) |
12 | end ) |
13 | end ) |