Coin count script/event

Description: Internal scripting system of SMBX-38A Engine based on the simple VB-like language
Moderators: Yoshi021, Lx Xzit, 5438A38A, Semi-moderatos, Moderators

Bulletbill510 M
Topic author, Good citizen
Good citizen
Bulletbill510 M
Topic author, Good citizen
Good citizen
Age: 22
Reputation: 6
Posts: 22
Joined: 17 May 2017

Post #1by Bulletbill510 » 3 Jul 2018, 22:39

I don't know if anyone has done this yet for a SMBX level but I was thinking of doing some kind of script in which an event is activated after collecting a certain amount of coins. These levels I might make will be based off of NSMB2 coin rush where you see how many coins you can collect, but in these levels I might make in the future, the player must collect a certain amount of coins in order for a star or exit to appear to beat the stage. But if there already is something in the editor that does that, then I guess I'll try other ways as well?
Note: I also forgot to mention that I was gonna think of script to make the coin counter go past 100 coins but not earn a 1-up so the player would have to collect a large amount of coins in my coin rush levels.
Feel free to visit my Youtube channel! Bulletbill510 :)

Lx Xzit M
Lx Xzit M
Reputation: 350
Posts: 724
Joined: 9 Nov 2015

Post #2by Lx Xzit » 4 Jul 2018, 0:03

Use this code to increase the amount of coins the player needs to gain an 1-up:

Code: Select all


This variable lets you keep track of your current coins:

Code: Select all


For example if you want a Star appears when the player got 200 coins (let's set the max limit of coins at 500), you should do a code like this:

Code: Select all

sysval(coinsforextralife) = 500
   if sysval(coincount) => 200 then
      call ncreate([parameters goes here])
      exit do
   end if
   call sleep(1)

This script must be triggered through an event. This is only an example but you could do it in other ways (all through scripting)
Join our 38A Discord server!


Return to “TeaScript”

Who is online (over the past 5 minutes)

Users browsing this forum: 1 guest