I am soooo pro in Lua, I got a 11/10 of IGN :O
Anyways, I am currently editing my Buffgauge for reasons that you may know if you spent 2 seconds of watching the last image but meh, I cannot get it work properly.
The Hud Drawing functions works properly, but the problem is actually the buffes themselves. The buffes do not affect the player stats. I firstly thought that this was because of repeating some "addHook" thingies, so I put them in separates lumps but meh.
Here are the codes, for each level...
Lvl 1
Lvl2
LVL 3
They are basically edits of each others.
Also note that the script worked properly when there was only one level set up
And again, sorry if I made a stupid misstake, but we learn from our fail...
(I will keep this thread for my other Lua cataclysms...
Anyways, I am currently editing my Buffgauge for reasons that you may know if you spent 2 seconds of watching the last image but meh, I cannot get it work properly.
The Hud Drawing functions works properly, but the problem is actually the buffes themselves. The buffes do not affect the player stats. I firstly thought that this was because of repeating some "addHook" thingies, so I put them in separates lumps but meh.
Here are the codes, for each level...
Lvl 1
Code:
addHook("ThinkFrame", do
for player in players.iterate
if not player.mo continue end
if stplyr.mo.health >= 16
and stplyr.mo.health < 31
local pa = player.charability
if pa == CA_THOK
or pa == CA_HOMINGTHOK
or pa == CA_JUMPBOOST
or pa == CA_AIRDRILL
or pa == CA_FALLSWITCH
and not stplyr.powers [pw_super]
player.acceleration = 43
player.accelstart = 103
elseif pa == CA_FLY
or pa == CA_SWIM
or pa == CA_SLOWFALL
or pa == CA_FLOAT
or pa == CA_DOUBLEJUMP
or pa == CA_TELEKINESIS
or pa == CA_NONE
and not stplyr.powers [pw_super]
player.jumpfactor = 78643
elseif pa == CA_GLIDEANDCLIMB
and not stplyr.powers [pw_super]
player.actionspd = 32 * FRACUNIT
end
else
local pa = player.charability
if pa == CA_THOK
or pa == CA_HOMINGTHOK
or pa == CA_JUMPBOOST
or pa == CA_AIRDRILL
player.normalspeed = skins[player.mo.skin].normalspeed
player.acceleration = skins[player.mo.skin].acceleration
player.accelstart = skins[player.mo.skin].accelstart
elseif pa == CA_FLY
or pa == CA_SWIM
or pa == CA_SLOWFALL
or pa == CA_FLOAT
or pa == CA_DOUBLEJUMP
or pa == CA_TELEKINESIS
player.jumpfactor = skins[player.mo.skin].jumpfactor
player.acceleration = skins[player.mo.skin].acceleration
player.accelstart = skins[player.mo.skin].accelstart
elseif pa == CA_GLIDEANDCLIMB
player.actionspd = skins[player.mo.skin].actionspd
player.normalspeed = skins[player.mo.skin].normalspeed
end
end
end
end)
Lvl2
Code:
addHook("ThinkFrame", do
for player in players.iterate
if not player.mo continue end
if stplyr.mo.health >= 31
and stplyr.mo.health < 61
local pa = player.charability
if pa == CA_THOK
or pa == CA_HOMINGTHOK
or pa == CA_JUMPBOOST
or pa == CA_AIRDRILL
or pa == CA_FALLSWITCH
and not stplyr.powers [pw_super]
player.normalspeed = 42 * FRACUNIT
player.acceleration = 43
player.accelstart = 103
elseif pa == CA_FLY
or pa == CA_SWIM
or pa == CA_SLOWFALL
or pa == CA_FLOAT
or pa == CA_DOUBLEJUMP
or pa == CA_TELEKINESIS
or pa == CA_NONE
and not stplyr.powers [pw_super]
player.jumpfactor = 72643
player.acceleration = 55
player.accelstart = 210
elseif pa == CA_GLIDEANDCLIMB
and not stplyr.powers [pw_super]
player.actionspd = 32 * FRACUNIT
player.normalspeed = 40 * FRACUNIT
end
else
local pa = player.charability
if pa == CA_THOK
or pa == CA_HOMINGTHOK
or pa == CA_JUMPBOOST
or pa == CA_AIRDRILL
player.normalspeed = skins[player.mo.skin].normalspeed
player.acceleration = skins[player.mo.skin].acceleration
player.accelstart = skins[player.mo.skin].accelstart
elseif pa == CA_FLY
or pa == CA_SWIM
or pa == CA_SLOWFALL
or pa == CA_FLOAT
or pa == CA_DOUBLEJUMP
or pa == CA_TELEKINESIS
player.jumpfactor = skins[player.mo.skin].jumpfactor
player.acceleration = skins[player.mo.skin].acceleration
player.accelstart = skins[player.mo.skin].accelstart
elseif pa == CA_GLIDEANDCLIMB
player.actionspd = skins[player.mo.skin].actionspd
player.normalspeed = skins[player.mo.skin].normalspeed
end
end
end
end)
LVL 3
Code:
addHook("ThinkFrame", do
for player in players.iterate
if not player.mo continue end
if stplyr.mo.health >= 61
local pa = player.charability
if pa == CA_THOK
or pa == CA_HOMINGTHOK
or pa == CA_JUMPBOOST
or pa == CA_AIRDRILL
or pa == CA_FALLSWITCH
and not stplyr.powers [pw_super]
player.normalspeed = 46 * FRACUNIT
player.acceleration = 43
player.accelstart = 103
elseif pa == CA_FLY
or pa == CA_SWIM
or pa == CA_SLOWFALL
or pa == CA_FLOAT
or pa == CA_DOUBLEJUMP
or pa == CA_TELEKINESIS
or pa == CA_NONE
and not stplyr.powers [pw_super]
player.jumpfactor = 78643
player.acceleration = 55
player.accelstart = 210
elseif pa == CA_GLIDEANDCLIMB
and not stplyr.powers [pw_super]
player.actionspd = 37 * FRACUNIT
player.normalspeed = 40 * FRACUNIT
end
else
local pa = player.charability
if pa == CA_THOK
or pa == CA_HOMINGTHOK
or pa == CA_JUMPBOOST
or pa == CA_AIRDRILL
player.normalspeed = skins[player.mo.skin].normalspeed
player.acceleration = skins[player.mo.skin].acceleration
player.accelstart = skins[player.mo.skin].accelstart
elseif pa == CA_FLY
or pa == CA_SWIM
or pa == CA_SLOWFALL
or pa == CA_FLOAT
or pa == CA_DOUBLEJUMP
or pa == CA_TELEKINESIS
player.jumpfactor = skins[player.mo.skin].jumpfactor
player.acceleration = skins[player.mo.skin].acceleration
player.accelstart = skins[player.mo.skin].accelstart
elseif pa == CA_GLIDEANDCLIMB
player.actionspd = skins[player.mo.skin].actionspd
player.normalspeed = skins[player.mo.skin].normalspeed
end
end
end
end)
They are basically edits of each others.
Also note that the script worked properly when there was only one level set up
And again, sorry if I made a stupid misstake, but we learn from our fail...
(I will keep this thread for my other Lua cataclysms...