#knockback on hit help
8 messages · Page 1 of 1 (latest)
balls
“`
local plr = game.Players.LocalPlayer
local UIS = game:GetService("UserInputService")
local count = 0
local debounce = false
UIS.InputBegan:Connect(function(Input, IS)
if IS == true then return end
if debounce == true then return
end
if Input.UserInputType==Enum.UserInputType.MouseButton1 then
if count == 0 then
spawn(function()
wait(0.1)
count = count + 1
end)
local animation = plr.Character.Humanoid:LoadAnimation(script.Punch)
animation:Play()
game.ReplicatedStorage.CombatHit:FireServer()
debounce = true
end
debounce = false
if count == 1 then
count = 0
local animation = plr.Character.Humanoid:LoadAnimation(script.pp)
animation:Play()
game.ReplicatedStorage.CombatHit:FireServer()
print ("E key is pressed")
debounce = true
wait(1)
debounce = false
end
end
end)
“`
balls
server script:
i know i know