### Author Topic:  Var Scripts  (Read 507 times)

0 Members and 1 Guest are viewing this topic.

#### aaronsbillwa

• Jr. Member
• Posts: 34
• I've just joined the Fourms but playing since 1.75
• Xbox: aaronsbillwa
##### Var Scripts
« on: November 10, 2016, 10:54:39 PM »
Anyone that is good with var's can you help me. I was wondering how I can make a script that could draw from a history and not have to script every number in the world?
« Last Edit: November 11, 2016, 07:09:07 PM by aaronsbillwa »

#### AlienizdPixel

• Tester
• Supreme Member
• Posts: 2715
• Hello
• Awards
• Xbox: A1ienizdPixe1
##### Re: Var Scripts
« Reply #1 on: November 13, 2016, 08:20:48 AM »
Var [History:VarName]
Replace "History" with "SysHistory" to draw from the system history values ("History" is from the player), and "ClanHistory" to draw from a clan's history value
...and not have to script every number in the world?
I do not understand.
-Alionz

#### TheDestinedCrab

• Legendary Member
• Posts: 1368
• Did you see that? Me neither.
• Awards
##### Re: Var Scripts
« Reply #2 on: November 13, 2016, 08:56:47 AM »
...and not have to script every number in the world?
I do not understand.

He means not have to do something like this, i believe :

If
IsVar [name] = [1]
Then
...
ElseIf
IsVar [name] = [2]
Then
...

And so on.
Thanks Gold Knight for the amazing sig!

#### crazytater94

• Supreme Member
• Posts: 2640
• Mastering TM since 2011
• Awards
• Xbox: crazytater94
• PSN: crazytater94 (Inactive)
• Steam: crazytater94
##### Re: Var Scripts
« Reply #3 on: November 13, 2016, 10:24:53 AM »
Think of VAR as a high school algebra equivalent of "X" where it's value can change and isn't a set number.

So, if Var + 2 = Var2, then that would be like x + 2 = y.

Here's an example:

Var [MaxHP] = 10
// (the max health points equals 10)
Var [HP] = [history:Lvl] + 2
// (the player's current HP count is whatever level they are, +2 (sets level 1 to 3 hearts))

If
IsVar [HP] > [MaxHp]
Then
Var [HP] = [MaxHp]
Else
// (do nothing)
Endif

What that does, is set your max HP to 10 and your HP cannot go above 10.

Note: This does not actually work, it's just an example for var.

#### Lunar

• Elite Member
• Posts: 954
• The God of the Galaxy
• Awards
• Xbox: Qvzw
• PSN: Widumn_Boise
##### Re: Var Scripts
« Reply #4 on: November 15, 2016, 10:19:06 PM »
Does anyone even understand the question? Cause I don't, but if I did I would love to help.