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

Why isn't my Idle animation work, I'm referencing it but it still doesn't work why?

Asked by 4 years ago
Edited 4 years ago

I'm trying to make this

this is my script

local tool = script.Parent
local Player = game.Players.LocalPlayer
local UIS = game:GetService("UserInputService")
local debounce = false

tool.Equipped:Connect(function()
    print("Tool was equipped")
local Character = Player.Character
local Idle = Character:WaitForChild("Humanoid"):LoadAnimation(script.IdleAnim)
    Idle:Play()
    UIS.InputBegan:Connect(function(key, gpe)
        if gpe then return end
        if key.KeyCode == Enum.KeyCode.Z and debounce == false then
             debounce = true
            script.Parent.FireEquip:FireServer(debounce)
        elseif key.KeyCode == Enum.KeyCode.Z and debounce == true then
            debounce = false
            script.Parent.FireEquip:FireServer(debounce)
          end
    end)
end)

why doesn't it work?

Answer this question