How to check if a player has collected enough star coins when entering a warp

Post here for help and support regarding LunaLua and SMBX2's libraries and features.

Moderator: Userbase Moderators

zekene20
Goomba
Goomba
Posts: 4
Joined: Fri Nov 03, 2023 3:03 pm
Pronouns: he/him/his

How to check if a player has collected enough star coins when entering a warp

Postby zekene20 » Tue Dec 24, 2024 10:06 pm

I am wondering if there's a way to check if I can block a player from entering a warp if he does not have the required star coins. I know you can do it with Power Stars, but I wanted to use star coins instead.

proCoder
Shy Guy
Shy Guy
Posts: 5
Joined: Sat Mar 15, 2025 7:28 pm
Flair: The best coder (maybe)
Pronouns: he/him

Re: How to check if a player has collected enough star coins when entering a warp

Postby proCoder » Sun Mar 16, 2025 2:05 pm

I suppose you could do this:

Code: Select all

local starCoinsTotal = 3 -- Replace with how many star coins you placed in the editor
local starCoinsCollected = starCoinsTotal - #NPC.get(310)
But I don't actually know how to block the player from using a warp.
You could spawn some blocks to block the warp and then remove them when the player
gets enough, But if you want to do it without that I've got nothing.
Last edited by proCoder on Sun Mar 16, 2025 2:07 pm, edited 1 time in total.


Return to “LunaLua Help”

Who is online

Users browsing this forum: No registered users and 3 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari