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

Why wont the animation play in this script, and could ive done it easier?

Asked by 4 years ago
Edited 4 years ago

Can i some how add debounce or something to make animation play or?

local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local UserInputService = game:GetService("UserInputService")
local Humanoid = Character.Humanoid


local Tapped = false
local T = 0.5

local DashNapredAnim = Instance.new("Animation")
 DashNapredAnim.AnimationId = 'rbxassetid://04783114765'
 PlayDashNapredAnim = Humanoid:LoadAnimation(DashNapredAnim)

UserInputService.InputBegan:Connect(function(input, gameprocesed)
    if input.KeyCode == Enum.KeyCode.W then
        if not Tapped then
            Tapped = true
            wait(T)
            Tapped = false
        else  
            PlayDashNapredAnim:Play()
            Character.HumanoidRootPart.Velocity = Character.HumanoidRootPart.CFrame.LookVector*150-Vector3.new(0,10,0) 
            end
        end
    end)

1 answer

Log in to vote
0
Answered by 4 years ago

Tapped is not a property

Ad

Answer this question