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

Can the .Touched event be overflowed? (no FilteringEnabled)

Asked by
y3_th 176
7 years ago
Edited 7 years ago

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.

1--victim
2 
3script.Parent.Touched:Connect(function(h)
4    if h.Name = "destroyer" then
5        script.Parent:Destroy() --destroyed when touches destroyer
6    end
7end)
1--destroyer
2 
3local rs = game:GetService("RunService")
4 
5rs.RenderStepped:Connect(function()
6    script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0, -0.25, 0)
7 
8    --all players are supposed to go to bottom of the screen, so they die if they remain at top
9end)

As one script; still doesn't work:

01--destroyer
02 
03local rs = game:GetService("RunService")
04 
05rs.RenderStepped:Connect(function()
06    script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0, -0.25, 0)
07 
08    --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
09end)
10 
11script.Parent.Touched:Connect(function(h)
12    if h.ClassName == "UnionOperation" then --players are in marbles
13        h:Destroy() --destroy marble
14    end
15end)
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. cabbler 1942 — 7y
0
I tried putting it all into one script, and it still didn't work. Any suggestions? y3_th 176 — 7y

Answer this question