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

Part.Touched Not Always Detecting?

Hi,

I want to make it so that when a player steps or jumps on a part, it fades completely and allows players to fall through. It works perfectly when you walk on top of them, but sometimes certain player characters (I found that mostly female characters can exploit this glitch) can hold the spacebar and jump fast enough to not touch the part and never fall through.

Here is what I have so far, located in a script under the part that will disappear:

local Tile = script.Parent

local function PlayerTouched(BodyPart)
	local Humanoid = BodyPart.Parent:FindFirstChildWhichIsA("Humanoid")
	if Humanoid then
		if Tile.Transparency == 0 then
			for count = 1, 10 do
				wait(0.015)
				Tile.Transparency = count*0.1
			end
			Tile.CanCollide = false
		end
	end
end

Tile.Touched:Connect(PlayerTouched)

Hopefully, I have been clear.

Thank you!

2 answers

Maybe you should see if the legs touch the tile, not the tile touching the legs.

4 comments

0

That makes sense...

0

But how would I do that?

0

That eats up a lot more resources

0

How does that eat up more resources when you have one signal instead of having many signals for each player?

This is just how Touched works if you want to always detect when they touch a tile, one method would be to detect when any Humanoid is in the minigame area and when their state changes to Enum.HumanoidStateType.Landed.

Alternatively, you could use Raycasting to detect any feet that come in contact with the tile.

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