local UIS = game:GetService("UserInputService")
local p = game.Players.LocalPlayer
chain = 0
--//Animations
local combat1 = Instance.new("Animation")
combat1.AnimationId = "http://www.roblox.com/Asset?ID=1530711495"
local animTrack1 = p.Character.Humanoid:LoadAnimation(combat1)
--
local function Combat(Input, gameProcessedEvent)
local KeyCode = Input.KeyCode
if KeyCode == Enum.UserInputType.MouseButton1 and script.canAttack == true and chain == 0 then
print("wow")
animTrack1:Play()
end
end
UIS.InputBegan:Connect(Combat)
COMMUNITY QUESTION
Having troubles finding the Error i made within this script and doesn't print wow, Any help?
1 answer
It looks fine, It could be that canAttack is false or maybe you can use classic mouse functions instead of UserInputService.
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
I found the problem, but this also works, so thank you
KeyDown is deprecated.