The .Touched event doesn't fire when an R6 avatar stands on a part and doesn't move/jump

  1. What do you want to achieve? Keep it simple and clear!
    Me and my friend are trying to make a spleef game (which you basically know what i am trying to achieve now)
  2. What is the issue? Include screenshots / videos if possible!
    The issue is that when an R6 avatar spawns in the air and then falls in the spleef part, the spleef part doesn’t dissapear
    Here is the script:
local debounce = true
script.Parent.Touched:Connect(function()
	if debounce == true and script.Parent.Transparency < 0.7 then
		debounce = false
		script.Parent.Transparency = 0.1
		wait(0.06)
		script.Parent.Transparency = 0.2
		wait(0.06)
		script.Parent.Transparency = 0.3
		wait(0.06)
		script.Parent.Transparency = 0.4
		wait(0.06)
		script.Parent.Transparency = 0.5
		wait(0.06)
		script.Parent.Transparency = 0.6
		wait(0.06)
		script.Parent.Transparency = 0.7
		script.Parent.CanCollide = false
		wait(0.06)
		script.Parent.Transparency = 0.8
		wait(0.06)
		script.Parent.Transparency = 0.9
		wait(0.06)
		script.Parent.Transparency = 1
		debounce = true --Part becomes Collideable and visible when the round ends
	end
end)
  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I didn’t find any solution in there.

Tip: Instead of using all those wait(0.06)s you can use a for loop

for i = 0, 1, 0.1 do
wait(0.06)
script.Parent.Transparency = i
end
1 Like

Didn’t think of that since the code worked anyways but thanks for the tip and thats not my main question here

Also, you should detect if a player is touching the part. It could be being triggered by another part.

script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
**your code here**
end
end)
1 Like

But that still doesn’t answer to my main question

Well is the brick lower than 0.7 transparency?

It can’t be the reason since the .Touched event doesn’t fire at all when an R6 avatar touches it

It could be, if the transparency is not less than 0.7 it will not run at all.

Try this:

local debounce = true
script.Parent.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") and debounce then
	    debounce = false
	    for T = 0,1,0.1 do
		    script.Parent.Transparency = T
		    wait(0.06)
		end
    	script.Parent.CanCollide = true
        debounce = true
	end	
end)

It works well

2 Likes

Have you read the comment in the script

Does it also work for R6 avatars? Because it just looks like an optimized script for me

1 Like

Tried it with R6 and R15, they both work.

It works for every avatar actually

1 Like