i can't change characters - LUA, earthquake

I have some problems. Don't call me dumb, when read the CoDe.



local function MyCustomAbility(player)
if player.mo.skin ~= "white" then
return
end

if (player.cmd.buttons & BT_CUSTOM3) then

R_SetPlayerSkin(7,whiteice)
P_DoSuperTransformation(whiteice, true)
P_Earthquake = 30
end
end

addHook("PlayerThink", MyCustomAbility)






I JUST DON'T KNOW, WHAT TO WRITE IN "pLAYER_T"
 
ok so. you have alright except functions
functions have different _t`s like mobj_t is player.mo or mo depending on what you put in the function of the hook, in your case its player.mo
in player_t its just player(your case) or mo.player.
so for example if you have a function like:
local function FunniesZip(mahfunnyobject)
then for player_t you would use mahfunnyobject.player
and for mobj_t use mahfunnyobject.
and when changing skins you need to have a string, a string is text inside " " or ' ' , so like if you want to switch to a character you would need:
R_SetPlayerSkin(player, "whiteice") if im right.
and for super trasformation function you would need to change white ice to player since its a player_t.
and the P_EarthQuake... functions never use =.

i hope that helped.
 

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

Back
Top