Sign in to follow this  

i got a small peice of beginner JS script and getting a build error, need some help

This topic is 2052 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

function Update ()
{
/*
var ammoBoxInt : int = 10;
var ammoBoxFloat : float = 5.567;
var ammoBoxString : String = "amoBox";
var ammoBoxBoolean : boolean = true;

print (ammoBoxInt);
print(ammoBoxFloat);
print(ammoBoxString);
print(ammoBoxBoolean);
*/

var inventory = Array ("spellBook", 23, 10.56,"ammo");
print (inventory);
var inventoryBooks = inventory(0);
print(inventoryBooks);
}

aight heres my code, the top part is commented out just for current teaching reasons for my self. the bottom part gets an error at line var inventoryBooks = inventory(0); not sure why i cant print out that part of an array, i just did as the tutoriol said and iv changed it a thousand times and i cant seem to figure it out!

any help please :P thanks guys!

Share this post


Link to post
Share on other sites
What ide/browser do you use?

All have consoles that outputs any error,
Chrome has "Developer Tools" Shift+Alt+I
Firefox has an excellent ad-don FireBug.

Share this post


Link to post
Share on other sites

This topic is 2052 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this