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?