So for my game i was wondering how i could make it so that the player can block when their sword is in hand. I tried doing this but it didnt work. (this is was in the starterplayer scripts) Note:This is just a animation.
UIS.InputBegan:Connect(function(input)
if input.KeyCode == enum.KeyCode.Q then
KeyQisBeingPressed = true
end
while KeyQisBeingPressed == true do
local Animation = player.Humanoid:LoadAnimation(block)
Animation:Play()
end
end)
UIS.InputEnded:Connect(function(input)
if input.KeyCode == enum.KeyCode.Q then
KeyQisBeingPressed = false
end
while KeyQisBeingPressed == false do
local Animation = player.Humanoid:LoadAnimation(block)
Animation:Stop()
end)
Variables:KeyQisBeingPressed -- boolean Variables:local block = game.starterpack.classicsword:WaitForChild('BlockAnim')

2 comments
Capitalize Enum
thats not the problem tho