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

Why won't my dash animation load?

Asked by 5 years ago

I made a script that's supposed to play a Forward Dash animation after I double tap ''W'' and for some reason, it just won't play. I can't find the issue in the script anywhere. I made a local script and a normal script.

Local script:

local RepStore = game:WaitForChild("ReplicatedStorage")
local Store = RepStore:WaitForChild("Storage")
local RemoteStore = Store:WaitForChild("RemoveEvents")
local Remote = RemoteStore:WaitForChild("FDashEvent")
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local userinput = game:GetService("UserInputService")






Cool = true
Ws = 0


userinput.InputBegan:connect(function(input)
    if input.KeyCode == Enum.KeyCode.W then 
    if Cool ~= true then return end 
        Ws = Ws + 1
        if Ws > 2 then
         Ws =2
          end 


    if Ws == 2 then

        Cool = false
        Remote:FireServer()  
        wait(1)
        Cool = true
    end
    wait(0.2)
    Ws = 0




    end
end)

===================================================================================================================================================

Regular script:

local RepStore = game:WaitForChild("ReplicatedStorage")
local Store = RepStore:WitForChild("Storage")
local RemoteStore = Store:WaitForChild("RemoveEvents")
local Remote = RemoteStore:WaitForChild("FDashEvent")


Remote.OnServerEvent:connect(function(player)



local Anim = Instance.new("Animation")
Anim.AnimationId ="rbxassetid://02667894858"                   
local move = player.Character.Humanoid:LoadAnimation(Anim)
move:Play()



local position = Instance.new("BodyVelocity",player.Character.HumanoidRootPart)
position.MaxForce = Vector3.new(5000000,5000000,5000000)
position.P = 100
position.Velocity = player.Character.HumanoidRootPart.CFrame.LookVector * 90
    game.Debris:AddItem(position,.5)

===================================================================================================================================================

Any ideas?

0
You can play player animations through a LocalScript and it will replicate to the server, Rheines 661 — 5y
0
If you insert some `print` statements, which parts get called? (Is the object really spelled `RemoveEvents`?) aschepler 135 — 5y
0
Oh, I was really tired when I typed all of this, thanks for catching that typo. Incinerxte 2 — 5y
0
Ok, the animation is playing now because I switched 'RemoveEvents' to 'RemoteEvents' Incinerxte 2 — 5y

Answer this question