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

Script not working properly with filtering enabled?

Hi. I'm trying to make a script that launches you in the air and this one works perfectly fine in a local test but not with filtering enabled. The script... well... "works?" It runs completely through and kinda launches you up but barely and makes you glitch a little up. This is contrary to with filtering enabled disabled where it launches you high up, working as intended. Thanks for any help!

power = "150"
cooldown = "0.5"
local debounce = false
function onTouched(part)
	if debounce == false then
		debounce = true
	if part.Parent ~= nil then
		local h = part.Parent:findFirstChild("Humanoid")
		if h~=nil then		
			h.Parent.Torso.Velocity=Vector3.new(0,power,0)
			script.Parent.ParticleEmitter:Emit(10)
			script.Parent.Sound:Play()
			wait(cooldown)
			debounce = false
		end			
	end
end
end

script.Parent.Touched:connect(onTouched)

3 comments

0

I don't understand your question... Does it work with filtering enabled or not?

0

:connect is deprecated use :Connect

0

it does work, although you don't get flung.

1 answer

✓ Accepted answer

Try an alternate approach with jump power.

power = "150"
local debounce = false
function onTouched(part)
	if debounce == false then
		debounce = true
	if part.Parent ~= nil then
		local h = part.Parent:findFirstChild("Humanoid")
		if h~=nil then		
			h.Parent.Humanoid.JumpPower = 375
			script.Parent.ParticleEmitter:Emit(10)
			script.Parent.Sound:Play()
			wait(.01)
			h.Parent.Humanoid.Jump = true
			wait(2)
			h.Parent.Humanoid.JumpPower = 80
			debounce = false
		end			
	end
end
end

script.Parent.Touched:Connect(onTouched)

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