-Compendium-
local pyromaniac on probation
I'm trying to replace a monitor for my character I'm working on, but I want it to only be available to that character. so I am wondering how I can do that with lua plz help
nevermind i figured it out
heres the code if anyone else is trying to do the same thing:
before you use this code you first need to define your monitor mobj using SOC or Lua then create the sprites.
info can be found here: https://wiki.srb2.org/wiki/Monitor
GIVE CREDIT IF YOU USE THIS CODE BY PROVIDING A LINK TO MY ACCOUNT: @-Compendium-
Post automatically merged:
nevermind i figured it out
heres the code if anyone else is trying to do the same thing:
Lua:
addHook("MobjSpawn", function(player) do
for mobj in mobjs.iterate()
for player in players.iterate()
if (mobj.flags & MF_MONITOR) and (player.mo.skin ~= "aj") continue end --skin and monitor check
if mobj.type != MT_WHIRLWIND_BOX continue end --if returns as whirlwind monitor
mobj.type = MT_GUN_BOX --replace with gun monitor
end
end
end
end)
before you use this code you first need to define your monitor mobj using SOC or Lua then create the sprites.
info can be found here: https://wiki.srb2.org/wiki/Monitor
GIVE CREDIT IF YOU USE THIS CODE BY PROVIDING A LINK TO MY ACCOUNT: @-Compendium-
Last edited: