SSG3
Oh, THAT Youtuber...
yeah... HUGE problem with an LUA script in my wad... an error occurs, but there's no error?
... returns in SRB2 "WARNING: METROIDSV5.WAD/LUA_METR: 137: ')' expected to close '(' at line 4 near end"
If anyone can help fix this, I'll credit them in the LUA script. (The addhook starts at line 4, if you were wondering)
Code:
addHook("ThinkFrame", do
for player in players.iterate
if player.mo and player.mo.skin == "metroidsonic" then
if not (player.charflags & SF_SUPER)
player.charflags = $1 + SF_SUPER
end
if player.screwjumps == nil
player.screwjumps = 0
end
if player.superfly == nil
player.superfly = 0
end
if not (player.cmd.buttons & BT_CUSTOM2) then
player.screwjumpready = true
player.screwjumping = false
elseif player.screwjumpready then
player.screwjumping = true
player.screwjumpready = false
else
player.screwjumping = false
end
if player.canscrew ~= 2 and player.jumping
and (player.screwjumps ~= 5) then
player.canscrew = 1
end
if P_IsObjectOnGround(player.mo) and (player.mo.eflags & MFE_ONGROUND)
player.canscrew = 0
player.isscrewing = 0
player.screwjumps = 0
player.stillscrewing = false
end
if not (P_IsObjectOnGround(player.mo))
and (player.canscrew ~= 2)
and not (player.canscrew == 0)
and (player.isscrewing ~= 2)
and (player.screwjumps ~= 5)
and (player.screwjumping)
and not (player.powers[pw_super])
and not (player.spectator)
and not (player.pflags & PF_NIGHTSMODE)
and not (player.mo.tracer and player.mo.tracer.type == MT_TUBEWAYPOINT)
and not (player.mo.state == S_PLAY_DIE) then
if (player.mo.eflags & MFE_UNDERWATER)
P_SetObjectMomZ(player.mo, 5*FRACUNIT, false)
else
P_SetObjectMomZ(player.mo, 10*FRACUNIT, false)
end
S_StartSound(player.mo, sfx_fre800)
player.screwjumps = $1 + 1
player.isscrewing = 1
if player.screwjumps >= 5
player.canscrew = 2
player.isscrewing = 2
end
player.stillscrewing = true
end
if (player.stillscrewing == true)
P_SpawnGhostMobj(player.mo)
end
if (player.screwjumping)
and (player.powers[pw_super])
and not (player.spectator)
and not (player.pflags & PF_NIGHTSMODE)
and not (player.mo.tracer and player.mo.tracer.type == MT_TUBEWAYPOINT)
and not (player.mo.state == S_PLAY_DIE) then
if player.superfly == 0
player.superfly = 1
player.mo.flags = $1|MF_NOGRAVITY|MF_SLIDEME
else
player.superfly = 0
player.mo.flags = $1 & ~(MF_NOGRAVITY|MF_SLIDEME)
end
if not (player.cmd.buttons & BT_CUSTOM1) then
player.shootmissile = true
player.shootingmissile = false
elseif player.shootmissile then
player.shootingmissile = true
player.shootmissile = false
else
player.shootingmissile = false
end
if not (player.cmd.buttons & BT_CUSTOM3) then
player.shootlaser = true
player.shootinglaser = false
elseif player.shootlaser then
player.shootinglaser = true
player.shootlaser = false
else
player.shootinglaser = false
end
if player.shootingmissile
and not (player.mo.state == S_PLAY_DIE)
and not (player.spectator)
and (player.mo.health > 1)
and not (player.pflags & PF_NIGHTSMODE) then
P_GivePlayerRings(player, -1)
local spawnedmissile = P_SPMAngle(player.mo, MT_JETTBULLET, player.mo.angle, 1)
S_StartSound(player.mo, sfx_s3k4d)
if not (spawnedmissile == nil)
spawnedmissile.flags2 = $1 + MF2_SUPERFIRE
else
end
end
if player.shootinglaser
and not (player.mo.state == S_PLAY_DIE)
and not (player.spectator)
and (player.mo.health > 5)
and not (player.pflags & PF_NIGHTSMODE) then
P_GivePlayerRings(player, -5)
local laser = P_SPMAngle(player.mo, MT_TORPEDO, player.mo.angle, 1)
S_StartSound(player.mo, sfx_rlaunc)
if not (laser == nil)
laser.flags2 = $1 + (MF2_SUPERFIRE|MF2_RAILRING)
else
end
end
end
end
end
end
end)
If anyone can help fix this, I'll credit them in the LUA script. (The addhook starts at line 4, if you were wondering)