It's always 10x easier to understand a script you wrote than one someone else wrote, commented or no. You just gotta plunge into it.
Printable View
It's always 10x easier to understand a script you wrote than one someone else wrote, commented or no. You just gotta plunge into it.
What're you crazy. It's very hard for me. Mainly the documentation. I really could use a dumbed down version. Example:Quote:
Yep you can use for loops in ZScript. For loop, While loop, Do Loop (i think never tried it). It seems you guys are picking up scripting pretty quickly.. (now you probley get why everyone always says its not that hard to understand )
I'm just stabbing in the dark with some of these...I'm not really sure the difference between something like Game->Counter[CR_LIFE] = 0, Or LinkCurHP =0 ? CR_LIFE is Current life...right.Code:item script Wand_of_Wonder
{
void run()
{
if(Game->Counter[CR_RUPEES] == 0 // Or LinkRup == 0 ?
Game->PlaySound(2);
waitframe();
Game->PlaySound(2);
waitframe();
Game->PlaySound(2);
waitframe();
Game->PlaySound(2);
waitframe();
Game->PlaySound(2);
Game->Counter[CR_RUPEES] = 5;
waitframes(6);
CreateNPC(105) }
else if(Game->Counter[CR_PUPEES] >= 1 {
waitframe();
playsound(15);
Game->Counter[CR_LIFE] = 0; // Or LinkCurHP = 0 ?
}
}
}
Aaaaargg!! I can't figure out the rupee references or manipulating door functions!! Help!
Maybe for the doors...?Code:item script Door_Buster
{
void run()
{
if (Link->HP <= 96){
Game->PlaySound(9);
Quit();
} else if (Link->MP <= 96) {
Game->PlaySound(9);
Quit();
} else if (itemclass->Counter[CR_RUPEES]<= 66 {
Game->PlaySound(9);
Quit();
} else {
Link->HP -= 96;
Link->MP -= 96;
itemclass->Counter[CR_RUPEES]-= 66;
Screen->Door[D_UNLOCKED];
Game->PlaySound(34);
}
}
}
----------------------------------------------
Screen->Door[DIR_UP] = D_UNLOCKED;
Screen->Door[DIR_DOWN] = D_UNLOCKED;
Screen->Door[DIR_LEFT] = D_UNLOCKED;
Screen->Door[DIR_RIGHT] = D_UNLOCKED;
---------------------------------------------
I don't get it :confused:
If you want to manipulate the number of ruppees a player has, you need to manipulate the global counters. Not whether Link has a ruppee in his inventory. (He wont because they arn't equipment items.) Check the documentation for the COUNTER keeping track of ruppees.
Alright, Door Buster Buster Buster. ver.3
item script Door_Buster
Alright more problems...at least this one works!..sorta. LOL!!Code:{
void run()
{
if (Link->HP <= 80){
Game->PlaySound(9);
Quit();
} else {
if (Screen->Door[DIR_UP] == D_LOCKED){
Screen->Door[DIR_UP] = D_SHUTTER;
} else {
if (Screen->Door[DIR_DOWN] == D_LOCKED){
Screen->Door[DIR_DOWN] = D_SHUTTER;
} else {
if (Screen->Door[DIR_LEFT] == D_LOCKED){
Screen->Door[DIR_LEFT] = D_SHUTTER;
} else {
if (Screen->Door[DIR_RIGHT] == D_LOCKED){
Screen->Door[DIR_RIGHT] = D_SHUTTER;
}
Link->HP -= 80;
Game->PlaySound(27);
}
}
}
}
}
}
The version before this went like this:
It creates an unlocked door on all sides even if there was a wall there before!!! Oopsie.Code:{
void run()
{
if (Link->HP <= 80){
Game->PlaySound(9);
Quit();
} else {
Link->HP = 16;
Screen->Door[DIR_UP] = D_UNLOCKED;
Screen->Door[DIR_DOWN] = D_UNLOCKED;
Screen->Door[DIR_LEFT] = D_UNLOCKED;
Screen->Door[DIR_RIGHT] = D_UNLOCKED;
Game->PlaySound(27);
}
}
}
So anyway their getting more complicated..:scared: , and i'm trying to get it to create shutters on all doors, but only if it's a locked door. plus play sfx and take away hearts as well. Now it just does these things when it wants to. ...I know I fucked that part up, but i'm not sure how to get the && in there, or take the if's and else if's out........hmm....
EDIT: Ahhh fluckin a...........Door Buster Buster Buster BUSTER!
It won't compile,( unexpected else on line 23) and I can't figure out why???:confused:Code:
import "std.zh"
item script Door_Buster
{
void run()
{
if (Link->HP <= 80){
Game->PlaySound(9);
Quit();
} else if (Screen->Door[DIR_UP] == D_LOCKED &&
Screen->Door[DIR_DOWN] == D_LOCKED &&
Screen->Door[DIR_LEFT] == D_LOCKED &&
Screen->Door[DIR_RIGHT] == D_LOCKED) {
Screen->Door[DIR_UP] = D_SHUTTER ;
Screen->Door[DIR_DOWN] = D_SHUTTER ;
Screen->Door[DIR_LEFT] = D_SHUTTER ;
Screen->Door[DIR_RIGHT] = D_SHUTTER ;
Game->PlaySound(27);
Link->HP -= 80 ;
Quit();
}
} else if (Screen->Door[DIR_UP] == D_LOCKED &&
Screen->Door[DIR_DOWN] == D_LOCKED &&
Screen->Door[DIR_LEFT] == D_LOCKED) {
Screen->Door[DIR_UP] = D_SHUTTER ;
Screen->Door[DIR_DOWN] = D_SHUTTER ;
Screen->Door[DIR_LEFT] = D_SHUTTER ;
Game->PlaySound(27);
Link->HP -= 80 ;
Quit();
}
} else {
if (Screen->Door[DIR_UP] == D_LOCKED) &&
Screen->Door[DIR_DOWN] == D_LOCKED &&
Screen->Door[DIR_RIGHT] == D_LOCKED {
Screen->Door[DIR_UP] = D_SHUTTER ;
Screen->Door[DIR_DOWN] = D_SHUTTER ;
Screen->Door[DIR_RIGHT] = D_SHUTTER ;
Game->PlaySound(27);
Link->HP -= 80 ;
Quit();
}
} else {
if (Screen->Door[DIR_UP] == D_LOCKED) &&
Screen->Door[DIR_LEFT] == D_LOCKED &&
Screen->Door[DIR_RIGHT] == D_LOCKED {
Screen->Door[DIR_UP] = D_SHUTTER ;
Screen->Door[DIR_LEFT] = D_SHUTTER ;
Screen->Door[DIR_RIGHT] = D_SHUTTER ;
Game->PlaySound(27);
Link->HP -= 80 ;
Quit();
}
} else {
if (Screen->Door[DIR_DOWN] == D_LOCKED) &&
Screen->Door[DIR_LEFT] == D_LOCKED &&
Screen->Door[DIR_RIGHT] == D_LOCKED {
Screen->Door[DIR_DOWN] = D_SHUTTER ;
Screen->Door[DIR_LEFT] = D_SHUTTER ;
Screen->Door[DIR_RIGHT] = D_SHUTTER ;
Game->PlaySound(27);
Link->HP -= 80 ;
Quit();
}
} else {
if (Screen->Door[DIR_UP] == D_LOCKED) &&
Screen->Door[DIR_DOWN] == D_LOCKED {
Screen->Door[DIR_UP] = D_SHUTTER ;
Screen->Door[DIR_DOWN] = D_SHUTTER ;
Game->PlaySound(27);
Link->HP -= 80 ;
Quit();
}
} else {
if (Screen->Door[DIR_UP] == D_LOCKED) &&
Screen->Door[DIR_RIGHT] == D_LOCKED {
Screen->Door[DIR_UP] = D_SHUTTER ;
Screen->Door[DIR_RIGHT] = D_SHUTTER ;
Game->PlaySound(27);
Link->HP -= 80 ;
Quit();
}
} else {
if (Screen->Door[DIR_UP] == D_LOCKED) &&
Screen->Door[DIR_LEFT] == D_LOCKED {
Screen->Door[DIR_UP] = D_SHUTTER ;
Screen->Door[DIR_LEFT] = D_SHUTTER ;
Game->PlaySound(27);
Link->HP -= 80 ;
Quit();
}
} else {
if (Screen->Door[DIR_DOWN] == D_LOCKED) &&
Screen->Door[DIR_LEFT] == D_LOCKED {
Screen->Door[DIR_DOWN] = D_SHUTTER ;
Screen->Door[DIR_LEFT] = D_SHUTTER ;
Game->PlaySound(27);
Link->HP -= 80 ;
Quit();
}
} else {
if (Screen->Door[DIR_DOWN] == D_LOCKED &&
Screen->Door[DIR_RIGHT] == D_LOCKED {
Screen->Door[DIR_DOWN] = D_SHUTTER ;
Screen->Door[DIR_RIGHT] = D_SHUTTER ;
Game->PlaySound(27);
Link->HP -= 80 ;
Quit();
}
} else {
if (Screen->Door[DIR_LEFT] == D_LOCKED &&
Screen->Door[DIR_RIGHT] == D_LOCKED {
Screen->Door[DIR_LEFT] = D_SHUTTER ;
Screen->Door[DIR_RIGHT] = D_SHUTTER ;
Game->PlaySound(27);
Link->HP -= 80 ;
Quit();
}
} else {
if (Screen->Door[DIR_UP] == D_LOCKED) {
Screen->Door[DIR_UP] = D_SHUTTER;
Game->PlaySound(27);
Link->HP -= 80 ;
Quit();
}
} else if {
Screen->Door[DIR_DOWN] == D_LOCKED {
Screen->Door[DIR_DOWN] = D_SHUTTER;
Game->PlaySound(27);
Link->HP -= 80 ;
Quit();
}
} else if {
Screen->Door[DIR_LEFT] == D_LOCKED {
Screen->Door[DIR_LEFT] = D_SHUTTER;
Game->PlaySound(27);
Link->HP -= 80 ;
Quit();
}
} else if {
Screen->Door[DIR_RIGHT] == D_LOCKED {
Screen->Door[DIR_RIGHT] = D_SHUTTER;
Game->PlaySound(27);
Link->HP -= 80 ;
Quit();
}
} else {
Game->PlaySound(9);
Quit();
}
}
}
...Plus I think there's too many Braces in there....but I haven't even got there in the compiler....And now I am completely lost.
----------------------------------------------------------------------
And now the Door Buster Buster MAX!
Still, what I wan't to do is make it so non locked doors become locked also....and shutters become Walls!! ..sweet.Code:item script Door_Buster
{
void run()
{
if (Link->HP <= 80){
Game->PlaySound(9);
Quit();
}
if (Screen->Door[DIR_UP] == D_LOCKED &&
Screen->Door[DIR_DOWN] == D_LOCKED &&
Screen->Door[DIR_LEFT] == D_LOCKED &&
Screen->Door[DIR_RIGHT] == D_LOCKED) {
Screen->Door[DIR_UP] = D_SHUTTER ;
Screen->Door[DIR_DOWN] = D_SHUTTER ;
Screen->Door[DIR_LEFT] = D_SHUTTER ;
Screen->Door[DIR_RIGHT] = D_SHUTTER ;
Game->PlaySound(27);
Link->HP -= 80 ;
Quit();
}
if (Screen->Door[DIR_UP] == D_LOCKED && //55
Screen->Door[DIR_DOWN] == D_LOCKED &&
Screen->Door[DIR_LEFT] == D_LOCKED) {
Screen->Door[DIR_UP] = D_SHUTTER ;
Screen->Door[DIR_DOWN] = D_SHUTTER ;
Screen->Door[DIR_LEFT] = D_SHUTTER ;
Game->PlaySound(27);
Link->HP -= 80 ;
Quit();
}
if (Screen->Door[DIR_UP] == D_LOCKED &&
Screen->Door[DIR_DOWN] == D_LOCKED &&
Screen->Door[DIR_RIGHT] == D_LOCKED) {
Screen->Door[DIR_UP] = D_SHUTTER ;
Screen->Door[DIR_DOWN] = D_SHUTTER ;
Screen->Door[DIR_RIGHT] = D_SHUTTER ;
Game->PlaySound(27);
Link->HP -= 80 ;
Quit();
}
if (Screen->Door[DIR_UP] == D_LOCKED &&
Screen->Door[DIR_LEFT] == D_LOCKED &&
Screen->Door[DIR_RIGHT] == D_LOCKED) {
Screen->Door[DIR_UP] = D_SHUTTER ;
Screen->Door[DIR_LEFT] = D_SHUTTER ;
Screen->Door[DIR_RIGHT] = D_SHUTTER ;
Game->PlaySound(27);
Link->HP -= 80 ;
Quit();
}
if (Screen->Door[DIR_DOWN] == D_LOCKED &&
Screen->Door[DIR_LEFT] == D_LOCKED &&
Screen->Door[DIR_RIGHT] == D_LOCKED) {
Screen->Door[DIR_DOWN] = D_SHUTTER ;
Screen->Door[DIR_LEFT] = D_SHUTTER ;
Screen->Door[DIR_RIGHT] = D_SHUTTER ;
Game->PlaySound(27);
Link->HP -= 80 ;
Quit();
}
if (Screen->Door[DIR_UP] == D_LOCKED &&
Screen->Door[DIR_DOWN] == D_LOCKED) {
Screen->Door[DIR_UP] = D_SHUTTER ;
Screen->Door[DIR_DOWN] = D_SHUTTER ;
Game->PlaySound(27);
Link->HP -= 80 ;
Quit();
}
if (Screen->Door[DIR_UP] == D_LOCKED &&
Screen->Door[DIR_RIGHT] == D_LOCKED) {
Screen->Door[DIR_UP] = D_SHUTTER ;
Screen->Door[DIR_RIGHT] = D_SHUTTER ;
Game->PlaySound(27);
Link->HP -= 80 ;
Quit();
}
if (Screen->Door[DIR_UP] == D_LOCKED &&
Screen->Door[DIR_LEFT] == D_LOCKED) {
Screen->Door[DIR_UP] = D_SHUTTER ;
Screen->Door[DIR_LEFT] = D_SHUTTER ;
Game->PlaySound(27);
Link->HP -= 80 ;
Quit();
}
if (Screen->Door[DIR_DOWN] == D_LOCKED &&
Screen->Door[DIR_LEFT] == D_LOCKED) {
Screen->Door[DIR_DOWN] = D_SHUTTER ;
Screen->Door[DIR_LEFT] = D_SHUTTER ;
Game->PlaySound(27);
Link->HP -= 80 ;
Quit();
}
if (Screen->Door[DIR_DOWN] == D_LOCKED &&
Screen->Door[DIR_RIGHT] == D_LOCKED) {
Screen->Door[DIR_DOWN] = D_SHUTTER ;
Screen->Door[DIR_RIGHT] = D_SHUTTER ;
Game->PlaySound(27);
Link->HP -= 80 ;
Quit();
}
if (Screen->Door[DIR_LEFT] == D_LOCKED &&
Screen->Door[DIR_RIGHT] == D_LOCKED) {
Screen->Door[DIR_LEFT] = D_SHUTTER ;
Screen->Door[DIR_RIGHT] = D_SHUTTER ;
Game->PlaySound(27);
Link->HP -= 80 ;
Quit();
}
if (Screen->Door[DIR_UP] == D_LOCKED) {
Screen->Door[DIR_UP] = D_SHUTTER;
Game->PlaySound(27);
Link->HP -= 80 ;
Quit();
}
if (Screen->Door[DIR_DOWN] == D_LOCKED) {
Screen->Door[DIR_DOWN] = D_SHUTTER;
Game->PlaySound(27);
Link->HP -= 80 ;
Quit();
}
if (Screen->Door[DIR_LEFT] == D_LOCKED) {
Screen->Door[DIR_LEFT] = D_SHUTTER;
Game->PlaySound(27);
Link->HP -= 80 ;
Quit();
}
if (Screen->Door[DIR_RIGHT] == D_LOCKED) {
Screen->Door[DIR_RIGHT] = D_SHUTTER;
Game->PlaySound(27);
Link->HP -= 80 ;
Quit();
}
else Game->PlaySound(9);
Quit();
}
}
-Can anyone show me an easier way to do that so it doesn't take 2 years to write up?
How about this for 'Door buster Max'
Let me know if you don't understand anythingCode:item script Door_Buster
{
void run()
{
//Declare vars
//setup bool vars one to check if each door has been effected yet
//this creates a switch of sorts that only lets you effect each door directon once
bool dr_up = false;
bool dr_dn = false;
bool dr_lt = false;
bool dr_rt = false;
bool any_door = false;
// any_door checks if any door is changed, so you can latter decide if you want to play sound 27 and subtract 80 HP from Link
if (Link->HP <= 80){
Game->PlaySound(9);
Quit();
}
//Unlocked become locked
//locked become shutter
//shutter become wall
if (Screen->Door[DIR_UP] == D_UNLOCKED && dr_up == false) {
Screen->Door[DIR_UP] = D_LOCKED;
dr_up = true;
any_door = true;
}
if (Screen->Door[DIR_UP] == D_LOCKED && dr_up == false) {
Screen->Door[DIR_UP] = D_SHUTTER;
dr_up = true;
any_door = true;
}
if (Screen->Door[DIR_UP] == D_SHUTTER && dr_up == false) {
Screen->Door[DIR_UP] = D_WALL;
dr_up = true;
any_door = true;
}
if (Screen->Door[DIR_DOWN] == D_UNLOCKED && dr_up == false) {
Screen->Door[DIR_DOWN] = D_LOCKED;
dr_dn = true;
any_door = true;
}
if (Screen->Door[DIR_DOWN] == D_LOCKED && dr_up == false) {
Screen->Door[DIR_DOWN] = D_SHUTTER;
dr_dn = true;
any_door = true;
}
if (Screen->Door[DIR_DOWN] == D_SHUTTER && dr_up == false) {
Screen->Door[DIR_DOWN] = D_WALL;
dr_dn = true;
any_door = true;
}
if (Screen->Door[DIR_LEFT] == D_UNLOCKED && dr_up == false) {
Screen->Door[DIR_LEFT] = D_LOCKED;
dr_lt = true;
any_door = true;
}
if (Screen->Door[DIR_LEFT] == D_LOCKED && dr_up == false) {
Screen->Door[DIR_LEFT] = D_SHUTTER;
dr_lt = true;
any_door = true;
}
if (Screen->Door[DIR_LEFT] == D_SHUTTER && dr_up == false) {
Screen->Door[DIR_LEFT] = D_WALL;
dr_lt = true;
any_door = true;
}
if (Screen->Door[DIR_RIGHT] == D_UNLOCKED && dr_up == false) {
Screen->Door[DIR_RIGHT] = D_LOCKED;
dr_rt = true;
any_door = true;
}
if (Screen->Door[DIR_RIGHT] == D_LOCKED && dr_up == false) {
Screen->Door[DIR_RIGHT] = D_SHUTTER;
dr_rt = true;
any_door = true;
}
if (Screen->Door[DIR_RIGHT] == D_SHUTTER && dr_up == false) {
Screen->Door[DIR_RIGHT] = D_WALL;
dr_rt = true;
any_door = true;
}
if (any_door == true) {
Game->PlaySound(27);
Link->HP -= 80 ;
}
else
{
Game->PlaySound(9);
}
<_< This is where we teach about loops:
Code:item script Door_Buster_Omega {
void run() {
int i; //we'll use this to loop
bool any; //if we actually do anything, this will become true
//for loops are used to loop over a range of numbers, like 1, 2, 3.
//DIR_UP and the like are just numbers, so we can loop over them too.
//DIR_UP, DIR_DOWN, DIR_LEFT, DIR_RIGHT
//for loops have three sections:
// for( start ; condition ; loop) { ... }
// 'start' is what to do first. We start by setting i to DIR_UP
// as long as 'condition' is true, the loop will continue. DIR_RIGHT is the last value, so we want to loop as long as i <= DIR_RIGHT
// each time the block gets to the bottom, it will run 'loop'.
// in this case, we add one to i
for(i = DIR_UP; i <= DIR_RIGHT; i ++) {
//is this door locked? (note that we don't care what specific direction it is)
if(Screen->Door[i] == D_LOCKED) {
//unlock it
Screen->Door[i] = D_SHUTTER;
any = true;
//is the door already unlocked?
} else if(Screen->Door[i] == D_UNLOCKED) {
//lock it back up :D
Screen->Door[i] = D_LOCKED;
any = true;
//or, is it a shutter?
} else if(Screen->Door[i] == D_SHUTTER) {
//Wall 'em in.
Screen->Door[i] = D_WALL;
any = true;
}
// 'loop' will be run here, to move to the next wall
}
//now that we are finished the loop, we can check to see if we did anything.
if(any) {
//do stuff if we succeeded
Game->PlaySound(27); //there are also SFX_* constants
Link->HP -= 80; //5 hearts? ouch.
} else {
//do other stuff if we did nothing.
Game->PlaySound(9);
}
}
}
Wow! You guys are awesome. It's gonna take me awhile to go through those but in the meantime a couple of questions:
-Howabout some script showcase/tutorials? What I mean is kind of like here, where you have a really simple script and variations on it, where each one can be broken down a bit and explained "why it works". While not really a tutorial exactally, it would certainly help out alot of the script-challenged masses that are smashing their faces against the keyboard. (myself included)
:computer: ....... :confuse2: ........... :angry: .......... :mad2: ........... :banghead:
-Also I can't figure out how to check rupees. I got as far as amount and max, and the documentation say's it uses the drain counter....which is too much for me at my scripting level of......noob. So something reletively simple like (-1 rupee , or -3 rupee if rupee > 0) on item use is over my head. -DCounter[]??
..and Item lv. I'm not sure about this either
Can there be a temporary lv+ ? Like wand lv1: -1 rupee +1 lv of wand.Quote:
bool Keep
* If true, Link will keep the item, and it will show up as an item or
* equipment in the subscreen. If false, it may modify the current value
* or maximum value of its counter (see Counter below), then disappear.
* The White Sword and Raft, for instance, have Keep true, and keys and
* rupees have Keep false.
int Counter
* The game counter whose current and modified values might be modified
* when the item is picked up (see Amount, Max, and MaxIncrement above.)
* Use the CT_ constants in std.zh to set or compare this value.
+20,000 more questions but bool and loop will keep me busy for a while..hah!
EDIT: well I can't figure out anything that I actually need for scripts that I would like for my quest so.....HERE'S SOMETHING COMPLETELY RANDOM!
EDIT 2: i now give you the *MOST BESTEST SCRIPT EVER!!*Code:item script Cursed_Sword
{
void run()
{
if (Screen-NumNPCs() == 0) { // create a wizzrobe if there are no enemies
screen->CreateNPC(56); // Or screen->CreateNPC(NPC_WIZZROBE1)?????
//i should test it.
} else { //otherwise...
npc enemy = Screen->LoadNPC(1); // locate npc 1 (i'm getting it!)
enemy->HP += 1; // and make him stronger! (don't miss!)
}
}
Mwahahahhaahaha!!!!!!Code:Global script No_Cheating!!!
{
void run() {
int cheat;
if (cheat > 0) {
//[INSERT SCRIPT THAT CRASHES ZC HERE!!!]
// ..Lets see Someone make a cheat Program for ZC 2.5 now...Bastards!
Link->HP -=666;
Link->MaxHP -= 666;
}
}
}
.....seriously though, anyone know a quick way to crash zc on purpose.?:sb::giggle::p
Well, let's clean this up.
Code:item script Cursed_Sword
{
void run()
{
if (Screen-NumNPCs() == 0) { // Checks to see that there are no enemies.
// Remember, the script only runs once
// at the start of the room. So this
// script will add wizzrobes only to empty
// rooms. If you want to keep checking,
// you need to stick this if inside a while
// loop.
Screen->CreateNPC(56); // Screen must be capitalized. Number is
// proper.
} else { //otherwise...
npc enemy = Screen->LoadNPC(1); // locate npc 1 (i'm getting it!)
enemy->HP += 1; // and make him stronger!
// One more hp isn't much. Wooden
// Sword has power of 2.
}
}
Thaks again C-. It won't compile one of those two lines and now I know why. (Grr...a stupid lowercase s) F**** H***K** Donkey.....
But doesn't the item check for screen NPC == 0 every time it's used???
******************BUT CHECK THIS OUT!**************
That's at least three completed scripts i've created thus far that work how I want them to!!!!!! MFn Superfantastic!Code:Item script Consume_Rupees_Damnit
{
void run() {
if (Game->Counter[CR_RUPEES] >= 1 &&
Link->HP < Link->MaxHP)
{
Link->HP += 2;
Game->Counter[CR_RUPEES] -= 1;
}
}
}
-Also I WAS right for using *Game->Counter[CR_RUPEES]* to acess rupee counter. The problem was I kept fucking everything else up. Ha! ..well it's getting there. lol.
What I really DO need help on is temporary increase in damage(or lv[or whatever]) for the second half of my Item scripts to work properly.
} else if { :(