my inventory script is not working i got the concept of the script from this link Inventory, simple and easy
but i made it myself so here is my inventory script :
static var statInventory : Inventory;
var EmptySlot : Texture;
var inventoryWindow : Rect;
class InventoryItem
{
var ItemName : String;
var ItemTexture : Texture;
}
function OnAwake() {
inventoryWindow = new Rect (10, 10, 10, 10);
}
function Loot(){
if(GUI.Button (Rect (5,5,10,10), ""));
{
GUI.DrawTexture (Rect, EmptySlot)
}
else
{
GUI.DrawTexture (Rect, ItemTexture)
}
function CloseInventoryWindow(){
if (GUI.Button (Rect (10,10,150,100), "X")) {
inventoryWindow = false;
}
and here is my loot script on objects:
var ItemTexture :Texture;
var ItemName : String;
function Start()
{
var theInventoryItem : InventoryItem;
theInventoryItem.ItemName = ItemName;
theInventoryItem.ItemTexture = ItemTexture;
}
function OnMouseDown()
{
Loot ();
}
function Loot ()
{
if (clicked)
{
clicked = true;
}
Inventory.AddItem(TheInventoryItem);
theInventoryItem = null;
Destroy(this.gameObject);
}
now they will change this is just the basics but for the inventory script i keep getting this error:
Assets/Scripts/PlayerScripts/Inventory.js(19,1): BCE0044: expecting :, found ‘}’.
its telling me to put a colon but when i do it gives me a bunch of errors please help