Disabling alternate powerups

Need help with any SMBX game-related issues? Ask your questions here.
TheNightingale
Charged Spiny
Charged Spiny
Posts: 1971
Joined: Fri Apr 20, 2018 9:28 pm
Flair: And here comes the last great american dynasty
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
Foo
Foo
Posts: 1442
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
Charged Spiny
Charged Spiny
Posts: 1971
Joined: Fri Apr 20, 2018 9:28 pm
Flair: And here comes the last great american dynasty
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
Swooper
Swooper
Posts: 50
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
Buster Beetle
Buster Beetle
Posts: 441
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: No registered users and 1 guest