idc if im bumping an old topic or not, but i was too curious as to how this could be implemented. this can also easily be extended to keep the player from controlling virtually
anything.
Code: Select all
local player1 = Player();
local player2 = Player(2);
function onInputUpdate()
if(player1.powerup == 5) and (player1.altRunKeyPressing) then
player1.altRunKeyPressing = false;
end
if(player2 ~= nil) then
if(player2.isValid) then
if(player2.powerup == 5) and (player2.altRunKeyPressing) then
player2.altRunKeyPressing = false;
end
end
end
end
5 is the Tanooki suit's powerup index. I tested this in a lunadll.lua file but I'm sure it'll work fine in a lunaworld.lua file.