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

Having troubles finding the Error i made within this script and doesn't print wow, Any help?

Asked by
oSyM8V3N 429 Moderation Voter
6 years ago
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)

1 answer

Log in to vote
0
Answered by
imaski4 42
6 years ago

It looks fine, It could be that canAttack is false or maybe you can use classic mouse functions instead of UserInputService.

0
I found the problem, but this also works, so thank you oSyM8V3N 429 — 6y
0
KeyDown is deprecated. theCJarmy7 1293 — 6y
Ad

Answer this question