I intend to use the .Touched event in order to delete players that fall behind and get consumed by a part, but whenever they touch 2 or more parts, they don't end up getting destroyed and stay. The intended outcome still occurs with players that touch less than 2 parts. I tested different functions that influence parts that are hit, yet the problem still persists.

--victim

script.Parent.Touched:Connect(function(h)
	if h.Name = "destroyer" then
		script.Parent:Destroy() --destroyed when touches destroyer
	end
end)
--destroyer

local rs = game:GetService("RunService")

rs.RenderStepped:Connect(function()
	script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0, -0.25, 0)

	--all players are supposed to go to bottom of the screen, so they die if they remain at top
end)

As one script; still doesn't work:

--destroyer

local rs = game:GetService("RunService")

rs.RenderStepped:Connect(function()
	script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0, -0.25, 0)

	--all players are supposed to go to bottom of the screen, so they die if they remain at top; destroyer goes down, players go down or die
end)

script.Parent.Touched:Connect(function(h)
	if h.ClassName == "UnionOperation" then --players are in marbles
		h:Destroy() --destroy marble
	end
end)

2 comments

0

Touched will not overflow it fires upon any intersection or would-be intersection. The physics is quite good about that. Maybe it's the over complication you have created.

0

I tried putting it all into one script, and it still didn't work. Any suggestions?