Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

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

2 comments

0

I found the problem, but this also works, so thank you

0

KeyDown is deprecated.

This discussion is preserved as it was. New answers, comments, and votes are closed.