Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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?

3 comments

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.

0

checking their y position :p

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!

2 answers

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)

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)

1 comment

0

first of all it's called Baseplate not Base, second of all your concatenation is wrong

This discussion is preserved as it was. New answers, comments, and votes are closed.