I wrote a custom function intended to add an Inventory item to the player while also notifying that the item has been added.
function Notify(InventoryItem*item){ //not the best function name but I'll change that later
AddedInv.Text = item.Name;
player.AddInventory(item);
gNotification.Transparency = 100;
gNotification.Visible = true;
while (gNotification.Transparency >= 10){
gNotification.Transparency -= 10;
Wait(1);
}
gNotification.Transparency = 0;
WaitMouseKey(1000);
while (gNotification.Transparency <= 90){
gNotification.Transparency += 10;
Wait(1);
}
gNotification.Visible = false;
}
In the header of GlobalScript I imported the function like this:
import function Notify(InventoryItem);
However, when I run the game I get this error:
Parameter type does not match prototype
Now I am new to using pointers and I don't have a lot of experience writing my own functions. I'm guessing I imported the function wrong or I used pointers incorrectly.
Use this:
import function Notify(InventoryItem*item);
That did the trick. Thanks, Khris!