J
Joshua Hotchin
Guest
Hey everyone,
This sh*t is driving me insane and idk why its happening.
It an instances create event it is
but when hasgun == true it sends me to rEnding and gives me an error saying
if anyone could please help me that would be great!!!!!!!
This sh*t is driving me insane and idk why its happening.
It an instances create event it is
Code:
if (global.hasgun)
{
target = rLvTwo;
}
else
{
target = rEnding;
}
and here is my oEnding create event:tryig to index a varriable which is not an array at gml_Object_oEnding_Create_0 (line to) - length = string_length(endtext[currentline]);
Code:
stats = "Stats:\nKills: " + string(global.kills) + " \nDeaths: " + string(global.deaths) + " \nSigns read: " + string(global.signsread) + "\nJumps: " + string(global.jumps) + "\nShots fired: " + string(global.shotsfired) + "\nTimes song skipped: " + string(global.musicskips) + "\nEnemy shots fired: " + string(global.enemyshotsfired) + "\nItems picked up: " + string(global.itempickups);
gunsprite = layer_sprite_get_id("TitleAssets","gGun");
if (global.hasgun == true) && (global.kills > 0)
{
endtext[0] = "And on this day our hero had slain " + string(global.kills) + " people.";
if (global.kills == 1) endtext[0] = "And on this day our hero killed a guy for no reason.";
endtext[1] = "But some of those people had guns too, so...";
endtext[2] = "He was probably saving the world, or something.";
endtext[3] = "Regardless, he was arrested two days later spent the rest of his life in prison.";
endtext[4] = "The defense team tried to argue that the sexy recoil effects and hit flashes were to blame,\nbut to no avail.";
endtext[5] = "The park ranger would later state she was \"not angry, just disappointed.\"";
endtext[6] = "The end!";
endtext[7] = stats;
}
if (global.cheated == true)
{
endtext[0] = "WOW! You completed the game with a gun without killing anyone!\nYou should be a police officer or something.\nNo, seriously. How did you do it.\n1. It would take forever to complete the game without killing anyone, and\n2. How did you get through the game without dying???\nDid you hack the game or something?\nAnyway, well done!!!";
endtext[1] = "The end!";
endtext[2] = "*cough* cheater *cough*";
endtext[3] = "Seriously though, you are a cheater. Honestly not possible what you did!";
endtext[4] = "And for cheating you will not be punished, you will have to sit here and read all of these messages.";
endtext[5] = "MWWHAHAHHA!!\nHow evil of me?\nI mean, you could press escape and return to the main menu :(";
endtext[6] = "Just do it, I know you want to.\nNo one want to talk to me.\nThe lonely narrator!";
endtext[7] = "Honestly, goodbye.\nJust press escape now!";
endtext[8] = "Ok, I am sorry for trying to punish you.\nGoodbye!";
endtext[9] = "Bye!\nLeave NOW!!\nLEAVE NOW!!!\nNOW!!";
endtext[10] = "Ok, I am leaving now\nGoodbye!";
endtext[11] = "BYEEEE!!!!";
endtext[12] = "The end!";
}
if (global.hasgun == false)
{
layer_sprite_destroy(gunsprite);
endtext[0] = "That was all, our player had decided not to pick\ntheir gun so therefor the game was over!";
endtext[1] = "The end!";
}
if (global.doesntwanttoplay == true)
{
endtext[0] = "It turns out our player didn't want to play this game.\nSo they decided to go back to their life.";
endtext[1] = "The end!";
}
spd = 0.5;
letters = 0;
currentline = 0;
length = string_length(endtext[currentline]);
text = "";