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

Script not working properly with filtering enabled?

Asked by 5 years ago

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)

0
I don't understand your question... Does it work with filtering enabled or not? Pojoto 329 — 5y
0
:connect is deprecated use :Connect MythicalShade 420 — 5y
0
it does work, although you don't get flung. awad6314 9 — 5y

1 answer

Log in to vote
0
Answered by
Voy1980 111
5 years ago

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)

Ad

Answer this question