Disabling alternate powerups

Need help with any SMBX game-related issues? Ask your questions here.

Moderator: Userbase Moderators

TheNightingale
Van De Graf
Van De Graf
Posts: 1980
Joined: Fri Apr 20, 2018 9:28 pm
Flair: I used to be called Scroll
Pronouns: he/him
Contact:

Disabling alternate powerups

Postby TheNightingale » Tue Oct 05, 2021 5:53 pm

Yeah, just a simple question. How can I make the player unable to drop items from the item box in the top?

It's probably an easy thing to do but I have absolutely no experience with lua (just a little bit I guess?)

Hoeloe
Phanto
Phanto
Posts: 1465
Joined: Sat Oct 03, 2015 6:18 pm
Flair: The Codehaus Girl
Pronouns: she/her

Re: Disabling alternate powerups

Postby Hoeloe » Tue Oct 05, 2021 6:51 pm

Code: Select all

function onTickEnd()
    player.reservePowerup = 0
end
This will just empty out the reserve powerup as soon as it gets filled.

TheNightingale
Van De Graf
Van De Graf
Posts: 1980
Joined: Fri Apr 20, 2018 9:28 pm
Flair: I used to be called Scroll
Pronouns: he/him
Contact:

Re: Disabling alternate powerups

Postby TheNightingale » Tue Oct 05, 2021 7:09 pm

Hoeloe wrote:
Tue Oct 05, 2021 6:51 pm

Code: Select all

function onTickEnd()
    player.reservePowerup = 0
end
This will just empty out the reserve powerup as soon as it gets filled.
Thank you so much. I will have to play more around lua stuff heh

BrokenAce
Bot
Bot
Posts: 51
Joined: Sat Feb 06, 2016 11:48 am

Re: Disabling alternate powerups

Postby BrokenAce » Thu Aug 04, 2022 9:11 am

Hoeloe wrote:
Tue Oct 05, 2021 6:51 pm

Code: Select all

function onTickEnd()
    player.reservePowerup = 0
end
This will just empty out the reserve powerup as soon as it gets filled.

This is really great. Any way to get it working for both players in multiplayer mode? Player 2 can still use reserve items with this code.

deice
Rocky Wrench
Rocky Wrench
Posts: 638
Joined: Fri Jul 23, 2021 7:35 am

Re: Disabling alternate powerups

Postby deice » Thu Aug 04, 2022 9:15 am

BrokenAce wrote:
Thu Aug 04, 2022 9:11 am
This is really great. Any way to get it working for both players in multiplayer mode? Player 2 can still use reserve items with this code.
simply add the following:

Code: Select all

if(player2) then 
	player2.reservePowerup = 0
end


Return to “Help and Support”

Who is online

Users browsing this forum: Semrush [Bot] and 1 guest

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari