Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Is there a way to see if a player has fallen out of the world?

Asked by
IDKBlox 349 Moderation Voter
5 years ago

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?

0
I don’t think a function/event specifically for this exists. I would just check if the character is nil manually or through the CharacterRemoving event in the player, or use a part or Region3 to detect if anything fell out. User#20279 0 — 5y
0
checking their y position :p theking48989987 2147 — 5y
0
Denny, I just checked and apparently CharacterRemoving doesn't fire when the character falls out of the world... weird right? lol and Theking, that may be what I end up doing lol. Thank you! IDKBlox 349 — 5y

2 answers

Log in to vote
0
Answered by 5 years ago

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:

script.Parent.Touched:Connect(function(hit)
local hum = hit.Parent:FindFirstChild("Humanoid")
if hum then
print(hit.Parent.Name .. " has fell out of the world.")
end
end)
Ad
Log in to vote
0
Answered by 5 years ago

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:

game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(character)
        local HRP = character:FindFirstChild("HumanoidRootPart")
        character.ChildRemoved:Connect(function(childRemoved)
            if childRemoved == HRP then 
                local YValue = HRP.Position.Y
                if YValue < workspace.Base.Position.Y then 
                    print(player, "fell out of the world")
                end
            end
        end)
    end)
end)
0
first of all it's called Baseplate not Base, second of all your concatenation is wrong DeceptiveCaster 3761 — 5y

Answer this question