#combat script still aint workin

1 messages · Page 1 of 1 (latest)

granite fog
#

i have no clue what the problem is

near tangle
#

too long, can u narrow it down?

granite fog
#

im not sure what the problem is thats the thing i can try thou lemme see

#

local function getAnimation(char, keyDown, currentCharacter)
local values = char:WaitForChild("Values")
local hum = char:WaitForChild("Humanoid")

local combo = values:FindFirstChild("Combo")

print("combo value: " .. combo.Value)  -- check combo value

local Type = "M1"
local animation = assets.Animations[currentCharacter].Combat["Punch"..combo.Value]

if combo.Value >= 4 then
    print("combo value is >= 4")  -- combo is 4 or more
    if hum:GetState() == Enum.HumanoidStateType.Freefall or hum.FloorMaterial == Enum.Material.Air then
        print("in freefall or air, switching to downslam")  -- player in freefall or air, switch to downslam
        animation = assets.Animations[currentCharacter].Combat.Downslam
        Type = "Downslam"
    elseif keyDown then
        print("uppercut triggered")  -- uppercut condition triggered
        animation = assets.Animations[currentCharacter].Combat.Uppercut
        Type = "Uppercut"
    end
end

print("keyDown: " .. tostring(keyDown))  -- check if keyDown is true
print("final animation: " .. animation)  -- final animation selected
return Type, animation

end

#

if Type ~= "M1" then
m1Animation:AdjustSpeed(1.2)
end

humStuff({Humanoid = hum,WalkSpeed = 16,JumpHeight = 0,JumpPower = 0})

m1Animation:GetMarkerReachedSignal("swingreg"):Connect(function()
    humStuff({Humanoid = hum,JumpHeight = 0,JumpPower = 0,})

    local swingParams = {
        Sound = nil,
        Root = hrp,
        TimeLength = nil,
    }

    if Type == "M1" then
        swingParams.Sound = assets.Effects[currentCharacter].Combat.Swings["S"..combo]
        swingParams.TimeLength = assets.Effects[currentCharacter].Combat.Swings["S"..combo].TimeLength
    elseif Type =="Downslam" then
        swingParams.Sound = assets.Effects[currentCharacter].Combat.Swings.Downslam
        swingParams.TimeLength = assets.Effects[currentCharacter].Combat.Swings.Downslam.TimeLength
    elseif Type == "Uppercut" then
        swingParams.Sound = assets.Effects[currentCharacter].Combat.Swings.Uppercut
        swingParams.TimeLength = assets.Effects[currentCharacter].Combat.Swings.Uppercut.TimeLength
    end

    replicateWithinRange(hrp,50,"Global","Sound",swingParams)
end)

m1Animation.Stopped:Connect(function()
    m1:Destroy()
    attacking:Destroy()
end)

m1Animation:GetMarkerReachedSignal("hitreg"):Connect(function()
    humStuff({Humanoid = hum,JumpHeight = 0,JumpPower = 0,})

    local params = OverlapParams.new()
    params.FilterType = Enum.RaycastFilterType.Exclude
    params.FilterDescendantsInstances = {char, workspace.Map, workspace.Effects}

    task.delay(.15,function()
        m1:Destroy()
        attacking:Destroy()
    end)

    task.delay(.45,function()
        if check(values,{"Ragdoll","Stunned","Blocking","Dashing","Forward Dashing","M1","Attacking"},true) and combo < 4 then
            humStuff({Humanoid = hum,JumpHeight = 7.2,JumpPower = 50,})
        end
    end)
#

its just like u press m1 it doesnt work

#

basically

pastel night
eager cloudBOT
#

studio** You are now Level 15! **studio