I tried making a three kick combo but I don't see whats wrong with my script local remote = game:GetService("ReplicatedStorage"):WaitForChild("Combat") local replicatedStorage = game:GetService("ReplicatedStorage")
remote.OnServerEvent:Connect(function(player, Value) local character = workspace:WaitForChild(player.Name) if Value == "Kick" then player.Data.MeleeXP.Value = player.Data.MeleeXP.Value + math.random(1,5) local currentlyKicking = true
local randomValue = math.random(1, 2)
local animation = Instance.new("Animation", character)
animation.Name = "Kick"..randomValue
if randomValue == 1 then
animation.AnimationId = "rbxassetid//04690422836"
end
animation.AnimationId = "rbxassetid//04690433586"
else
animation.AnimationId = "rbxassetid//4690454032"
end
local animLoader = character:WaitForChild("Humanoid"):LoadAnimation(animation)
animLoader:Play()
local rightfoot = character:WaitForChild("RightFoot")
local leftfoot = character:WaitForChild("LeftFoot")
local rightfoot = character:WaitForChild("RightFoot")
rightfoot.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local hum = hit.Parent:FindFirstChild("Humanoid")
if hum.Parent.Name == player.Name and not hit.Parent:FindFirstChild("AlreadyHit")and currentlyKicking then
local f = Instance.new("IntValue", hum.Parent)
f.Name = "AlreadyHit"
game.Debris:AddItem(f ,0.75)
hum:TakeDamage(math.random(1, 10) + player.Data.MeleeLevel.Value)
local pnamex = Instance.new("StringValue", hit.Parent:FindFirstChild("PlayerWhoHit"))
pnamex.Name = "PlayerHitName"
pnamex.Value = player.Name
game.Debris:AddItem(pnamex, 2)
wait(1)
hum.WalkSpeed = 16
hum.JumpPower = 50
end
end
end)
leftfoot.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local hum = hit.Parent:FindFirstChild("Humanoid")
if hum.Parent.Name == player.Name and not hit.Parent:FindFirstChild("AlreadyHit")and currentlyKicking then
local f = Instance.new("IntValue", hum.Parent)
f.Name = "AlreadyHit"
game.Debris:AddItem(f ,0.75)
hum:TakeDamage(math.random(1, 10) + player.Data.MeleeLevel.Value)
local pnamex = Instance.new("StringValue", hit.Parent:FindFirstChild("PlayerWhoHit"))
pnamex.Name = "PlayerHitName"
pnamex.Value = player.Name
game.Debris:AddItem(pnamex, 2)
wait(1)
hum.WalkSpeed = 16
hum.JumpPower = 50
end
end
end)
rightfoot.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local hum = hit.Parent:FindFirstChild("Humanoid")
if hum.Parent.Name == player.Name and not hit.Parent:FindFirstChild("AlreadyHit")and currentlyKicking then
local f = Instance.new("IntValue", hum.Parent)
f.Name = "AlreadyHit"
game.Debris:AddItem(f ,0.75)
hum:TakeDamage(math.random(1, 10) + player.Data.MeleeLevel.Value)
local pnamex = Instance.new("StringValue", hit.Parent:FindFirstChild("PlayerWhoHit"))
pnamex.Name = "PlayerHitName"
pnamex.Value = player.Name
game.Debris:AddItem(pnamex, 2)
wait(1)
hum.WalkSpeed = 16
hum.JumpPower = 50
wait(0.5)
animLoader:Stop()
animation:Destroy()
end
end)
