LUA scripting downthrust problem

Maddshura

The gal who never finishes her maps
i looked at the thok lua and understand how it works and everything, but what do you change to make go up or down?
 
To make it go up or down, you use P_SetObjectMomZ(mobj, fixed move, boolean). mobj is the object you want to move and to move the player you would put in player.mo or some variation of that. fixed move is the amount you want to move the object. To go up, use a positive value like 8*FRACUNIT and to go down use a negative number (a number with a minus in front of it) like -8*FRACUNIT. boolean is used in the situation you want the momz value being added to or, if false, replacing your current momz and I don't really use the boolean that much, so don't worry about it too much. If you use it right, it may look like this: P_SetObjectMomZ(player.mo, 10*FRACUNIT, true)
 
so i made my code, does it work like this?

addHook("AbilitySpecial", function(player)
if player.mo.skin != "windknight"
local actionspd = FixedMul(player.mo.scale, player.actionspd)
if player.mo.eflags & MFE_UNDERWATER
actionspd = $/2
P_SetObjectMomZ(player.mo, FRACUNIT*10, true)
P_SpawnThokMobj(player)
S_StartSound(player.mo, sfx_break)
player.pflags = $|PF_THOKKED
return true
end
end
end)

also anyone that uses this code that is not trying to help ( im pointing at you geusts, you gambanana and mediafire pirates!)
i hope its correct
 
so i made my code, does it work like this?

addHook("AbilitySpecial", function(player)
if player.mo.skin != "windknight"
local actionspd = FixedMul(player.mo.scale, player.actionspd)
if player.mo.eflags & MFE_UNDERWATER
actionspd = $/2
P_SetObjectMomZ(player.mo, FRACUNIT*10, true)
P_SpawnThokMobj(player)
S_StartSound(player.mo, sfx_break)
player.pflags = $|PF_THOKKED
return true
end
end
end)

also anyone that uses this code that is not trying to help ( im pointing at you geusts, you gambanana and mediafire pirates!)
i hope its correct
the entire code is wrong
 
so i made my code, does it work like this?

addHook("AbilitySpecial", function(player)
if player.mo.skin != "windknight"
local actionspd = FixedMul(player.mo.scale, player.actionspd)
if player.mo.eflags & MFE_UNDERWATER
actionspd = $/2
P_SetObjectMomZ(player.mo, FRACUNIT*10, true)
P_SpawnThokMobj(player)
S_StartSound(player.mo, sfx_break)
player.pflags = $|PF_THOKKED
return true
end
end
end)

also anyone that uses this code that is not trying to help ( im pointing at you geusts, you gambanana and mediafire pirates!)
i hope its correct
ok so theres problems like:
This code will run for any character except windknight
the code will only run underwater.
Also idk if you want to make it infinite and add momentum.
 

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

Back
Top