#Sliding system

11 messages · Page 1 of 1 (latest)

clever dock
#

I have a working sliding system but I don't know how to add a delay so you can only do it like every 3 seconds so you can't spam it

jolly bramble
#

Can you paste the script in the chat so I can test it

azure kayak
#

isn't it just Wait(3) ?

jolly bramble
#

Yeah

clever dock
#

i don't want it to take 5 seconds to play

#

local UIS = game:GetService("UserInputService")
local char = script.Parent
local slideAnim = Instance.new("Animation")

slideAnim.AnimationId = "https://www.roblox.com/assets/?id=11215138847"

local keybind = Enum.KeyCode.LeftControl
local canslide = true
UIS.InputBegan:Connect(function(input,gameprocessed)
if gameprocessed then return end
if not canslide then return end

if input.KeyCode == keybind then
    canslide = false
    game.Workspace.slide:Play()
    local playAnim = char.Humanoid:LoadAnimation(slideAnim)
    playAnim:Play()
    
    local slide = Instance.new("BodyVelocity")
    slide.MaxForce = Vector3.new(1,0,1) * 30000
    slide.Velocity = char.HumanoidRootPart.CFrame.lookVector * 100
    slide.Parent = char.HumanoidRootPart
    
    for count = 1, 8 do
        wait(0.07)
        slide.Velocity *= .7
    end
    playAnim:Stop()
    game.Workspace.slide:Stop()
    slide:Destroy()
    canslide = true
    
end

end)

stone epoch
#

I remember doing this

#

You would put a wait before the canslide = true

#

@clever dock

clever dock
#

ok

#

thanks