Making a health bar in 38A

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

Hackplayer7 M
Topic author, Citizen
Citizen
Avatar
Hackplayer7 M
Topic author, Citizen
Citizen
Age: 13
Reputation: 1
Posts: 7
Joined: 6 Feb 2017

Post #1by Hackplayer7 » 22 Oct 2017, 2:08

I wish to make a Sonic health bar script for my 38A, unfortunately I know nothing in Teascript. Could anyone guide me?

What I want to do is something like this:
There would be a number variable in the top of the screen.
It would increase by 1 every time you collect NPC-152 (Ring) and go back to 0 if the player got hit.
If the player got hit while it showed 0, then it would trigger a death script.

I don't know if I'm doing it right, but it should look like something like this:

name variable: rings

if NPC-152 collected: increase by 1
if Player Hit: decrease to 0 (subtract the variable by itself)
if Player Hit and variable ''rings'' =0: Trigger death
If you wish to waste precious time, then my Youtube channel is for you!
Youtube Channel : https://www.youtube.com/channel/UC6C05VIpTq2JgafOV_V0jsQ
---------------------------------------------------------------------------------------------------------------
[img]http://wohlsoft.ru/images/userbars/SMBX38A_Userbar.png[/img]

Legendary quote from notrockythechao :
[size=85]Honestly, I'm with eri and helmetguy. When your troubleshooting advice boils down to "use our software instead" in a thread dedicated to their software, don't expect a warm reception. And I can't speak for the other devs but I, for one, don't appreciate the reputation we've gotten of hating SMBX38A and shoving SMBX2 down peoples' throats, so could y'all please, idk, stop going into 38A spaces and shoving SMBX2 down peoples' throats?[/size]

PvP_FINGER M
Citizen
Citizen
PvP_FINGER M
Citizen
Citizen
Reputation: 1
Posts: 5
Joined: 6 Jun 2018
Location: Larisi

Creation

Post #2by PvP_FINGER » 6 Jun 2018, 16:04

Create variable rings. It must equals starting rings + 15.
Create event add. Enter in the variables in add event, choose rings variable and set it to val(rings)+1.
Create event death. Enter in the others in the death event, set special event to Player.Death.
Now we must create script.

Code: Select all

start:
If char(1).status = 1 and val(rings) > 0 then
   if val(rings) <= 15 then
      val(rings) = 0
      char(1).status = 2
   else
      val(rings) = val(rings)-15 'Rings - 15
      char(1).status = 2
   end if
end if
If char(1).status = 1 and val(rings) <= 0 then
   Call TCreate(death,1)
end if
Call sleep(1)
Goto start

We must enter in Game - Start event, and set Scripts to script what we are created.
FINALY


Click left mouse button to the NPC-152 and enter in Events-I tab. Set Death event to "add".
And now...
REALLY_FINALY


Return to “TeaScript”

Who is online (over the past 5 minutes)

Users browsing this forum: 1 guest