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
6 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 — 6y
0
checking their y position :p theking48989987 2147 — 6y
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 — 6y

2 answers

Log in to vote
0
Answered by 6 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:

1script.Parent.Touched:Connect(function(hit)
2local hum = hit.Parent:FindFirstChild("Humanoid")
3if hum then
4print(hit.Parent.Name .. " has fell out of the world.")
5end
6end)
Ad
Log in to vote
0
Answered by 6 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:

01game.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)
13end)
0
first of all it's called Baseplate not Base, second of all your concatenation is wrong DeceptiveCaster 3761 — 6y

Answer this question