#Tool Damage

2 messages · Page 1 of 1 (latest)

torpid basin
#

Local Script:

local UIS = game:GetService("UserInputService")

local plr = game.Players.LocalPlayer
local character = plr.Character or plr.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local M1 = humanoid:LoadAnimation(script.Animations.M1)
local M2 = humanoid:LoadAnimation(script.Animations.M2)
local combo = 1
local cooldown = false
local lastcooldown = false
UIS.InputEnded:Connect(function(I, E)
if E then return end
if I.UserInputType == Enum.UserInputType.MouseButton1 then
if cooldown == true then return end
if lastcooldown == true then return end
spawn(function()
cooldown = true
task.wait(0.4)
cooldown = false
end)
if combo == 2 then
game.ReplicatedStorage.MainEvent:FireServer()
M2:Play()
spawn(function()
lastcooldown = true
task.wait(0.4)
lastcooldown = false
end)
spawn(function()
task.wait(.1)
combo = 1
end)
elseif combo == 1 then
game.ReplicatedStorage.MainEvent:FireServer()
M1:Play()
combo = combo + 1
end

end

end)

#

Script:
game.ReplicatedStorage.MainEvent.OnServerEvent:Connect(function(plr)
spawn(function()
plr.Character.Humanoid.Walkspeed = 7
task.wait(0.4)
plr.Character.Humanoid.Walkspeed = 7
end)

local hitbox = Instance.new("Part")

hitbox.Parent = workspace
hitbox.CanCollide = false
hitbox.Anchored = true
hitbox.Size = Vector3.new(5,4,3)
hitbox.BrickColor = BrickColor.new("Really red")
hitbox.Transparency = 0.5
hitbox.CFrame = plr.Character.HumanoidRootPart.CFrame * CFrame.new(0,0,-2.7)
game.Debris:AddItem(hitbox,0.4)
local hitboxcooldown = false
hitbox.Touched:Connect(function(hit)
if hit.Parent.Name ~= plr.Name and hit.Parent:FindFirstChild("Humanoid") then
    if hitboxcooldown == true then return end
    hitboxcooldown = true
    
    hit.Parent:FindFirstChild("Humanoid"):TakeDamage(20)
    local sound = script.hit_punch_l:Clone()
    sound.Parent = hit.Parent.HumanoidRootPart
    sound:Play()
    game.Debris:AddItem(sound,0.4)
    task.wait(0.4)
    hitboxcooldown = false
    
    
end
end)

end)