Help please MY BATTLE MOD ABILITIES ARENT WORKING PLEASE HELP

thesrb2fan12

That one guy making frontiers sonic
I keep Getting an error about that i need to close off Line 18 WHICH I DID SO PLEASE HELP
Lua:
if CBW_Battle == nil then
return end
local B = CBW_Battle
local S = B.SkinVars
local Act = B.Action
local G = B.GuardFunc
local ScriptLoaded = false
local function sbvars(m,pmo)
    if m and m.valid then
        m.fuse = 45
        m.momx = $ + pmo.momx/2
        m.momy = $ + pmo.momy/2
        S_StartSoundAtVolume(m,sfx_s3kb8,190)
    end
end


addHook("ThinkFrame", function()
if not(ScriptLoaded)
        and CBW_Battle
        then
        ScriptLoaded = true --setting this to true so that we know its loaded
        end
        
        

local CrossSlash = function(mo,doaction)
local player = mo.player



if not(B.CanDoAction(player))
player.actionstate = 0
return end

if player.actionstate == 0
if doaction == 1
player.actionstate = 1
player.actiontime = 0
B.PayRings(player)
S_StartSound(mo, sfx_s3k3c)
end
end
player.actiontext = "Cross Slash"
if not (P_IsObjectOnGround(mo)) then
player.actiontext = "Sonic Boom Kick"
end
player.actionrings = 10
if (P_IsObjectOnGround(mo)) then
if player.actionstate == 1
player.actiontime = $+1
                
                
                P_InstaThrust(mo,mo.angle,0)
                P_SetObjectMomZ(mo,P_MobjFlip(mo)*mo.scale,0)
                
                player.pflags = ($|PF_SPINNING)&~PF_JUMPED
                mo.state = S_PLAY_ROLL
                P_SpawnThokMobj(player)
                
                if player.actiontime == 20 then
                    player.actionstate = 2
                    player.actiontime = 0
                    S_StartSound(mo,sfx_s3k54)
                end
            end
if player.actionstate == 2
player.actiontime = $+1
                
                if player.actiontime%3==0
                    P_SPMAngle(mo,MT_ENERGYBLAST,player.mo.angle,0)
                end
                
                
                P_SetObjectMomZ(mo,P_MobjFlip(mo)*mo.scale*2,0)
                P_InstaThrust(mo,mo.angle+ANGLE_180,mo.scale*6)
                B.ApplyCooldown(player,TICRATE*4)
                mo.state = S_PLAY_FALL
                player.pflags = $&~(PF_SPINNING)
                player.drawangle = mo.angle
                
                
                if player.actiontime == 20
                    player.actionstate = 0
                end
            end
            end
            end
            if player.actiontext == "Sonic Boom Kick" then
            if player.actionstate == 1
player.actiontime = $+1
                
                
                P_InstaThrust(mo,mo.angle,0)
                P_SetObjectMomZ(mo,P_MobjFlip(mo)*mo.scale,0)
                
                player.pflags = ($|PF_SPINNING)&~PF_JUMPED
                mo.state = S_PLAY_ROLL
                P_SpawnThokMobj(player)
                
                if player.actiontime == 20 then
                    player.actionstate = 2
                    player.actiontime = 0
                    S_StartSound(mo,sfx_s3k54)
                end
            end
if player.actionstate == 2
player.actiontime = $+1
                
                if player.actiontime%3==0
                    local m = P_SPMAngle(mo,MT_SONICBOOM,player.mo.angle,0)
                    sbvars(m,mo)
        P_Thrust(mo,mo.angle+ANGLE_180,thrustfactor*5)
    
                end
                
                
                P_SetObjectMomZ(mo,P_MobjFlip(mo)*mo.scale*2,0)
                P_InstaThrust(mo,mo.angle+ANGLE_180,mo.scale*6)
                B.ApplyCooldown(player,TICRATE*4)
                mo.state = S_PLAY_SPINDASH
                player.pflags = $&~(PF_SPINNING)
                player.drawangle = mo.angle
                
                
                if player.actiontime == 20
                    player.actionstate = 0
                end
            end
            
            end
            end
            
        local PriorityFunc = function(player)
            if player.actionstate == 1 and player.actiontext == "Cross Slash" then
                B.SetPriority(player,1,3,nil,1,3,"Cross Slash Beam Attack")
                end
                if player.homing then
                B.SetPriority(player,1,3,nil,1,3,"Homing attack")
                end
                if player.pflags & PF_SPINNING
                B.SetPriority(player,1,3,nil,1,3,"Spin Attack")
                end
                if player.actiontext == "Sonic Boom Kick" and player.actionstate == 1 then
                B.SetPriority(player,1,3,nil,1,3,"Sonic Boom Kick")
                end
                end       

        )
        
        
        
 
                





S["fsonic"] = {
    flags = SKINVARS_GUARD,
    weight = 100,
    shields = 1,
    special = CrossSlash,
    
    guard_frame = 2,
    func_guard_trigger = G.Parry,
    func_priority = PriorityFunc,
    func_priority_ext = Act.EnergyAttack_Priority,
    func_precollide = nil,
    func_collide = nil,
    func_postcollide = nil,
    func_exhaust = nil,
    sprites = {}
}
 
Your script is nigh unreadable. Consider identing things properly; it usually helps identifying what's the actual problem that Lua is complaining about.

Also, consider posting the whole error straight from the console or the game log, don't paraphrase it. The error tends to provide more information.
 

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top