i need help fixing this script
<local rp = game:GetService("ReplicatedStorage")
local remotes = rp:WaitForChild("Remotes")
local punchRemote = remotes:WaitForChild("Punch")
local MAX_COMBO = 4
local function changeCombo(char)
local combo = char:GetAttribute("Combo")
if combo >= MAX_COMBO then
char:SetAttribute("combo",1)
else
char:SetAttribute("combo",combo + 1)
end
end
local function getPunchAnim(char)
local combo = char:GetAttribute("combo")
local punchAnims = animations:WaitForChild("Combat"):GetChildren()
local currAnim = punchAnim[combo]
return currAnim
end
punchRemote.OnServerEvent:Connect(function(player)
local char = player.Character
local hum = char:WaitForChild("Humanoid")
local humRp = char:WaitForChild("HumanoidRootPart")
local attacking = char:GetAttribute("Attacking")
local punching = char:GetAttribute("punch")
if attacking or punching then return end
char:SetAttribute("attacking",true)
char:SetAttribute("punching",true)
changeCombo(char)
local playPunchAnim = hum:LoadAnimation(getPunchAnim(char))
playpunchAnim.KeyframeReached:Connect(function(kf)
if kf == "Hit" then
char:SetAttribute("Attacking",false)
if char:GetAttribute("Combo") == MAX_COMBO then
task.wait(1)
end
char:SetAttribute("Punch",false)
end
end)
playPunchAnim:play()
end)> it says ServerScriptService.CombatServer:9: attempt to compare number <= nil
** You are now Level 3! **