Help with function working with inventories (SOLVED)

Greetings forums,

I have this POC of a modified + upgraded version of the inventory example, but while getting some help with some of the code, I ran into a problem when functions get involved.

So, I want to have this function get data to put items into the inventory directly by receiving data called in the function and moving the data to an external event.

Here’s the function:

Here’s the code trying to call said function:

And here’s the external event that’s meant to receive the function call’s parameters:

When I click this button in game, the item (Poto, in this case) is not added to my inventory. Is there something I’m doing wrong?

Any help is appreciated. Thanks

I’m pretty sure link events do not work in events based functions.

In that case, should I copy the events from the external link directly into the function then?

Okay, I’ve done some more experimenting, like moving the syntax from the link directly into the function, but the button still doesn’t work. I think I might’ve found one of the culprits:

For some reason, when I put this argument in, trying to get one of the parameters as a string, it says it requires a number.

What do I put when I want the code to get the parameter as a string instead of an integer?

Thanks

Since nobody has replied yet, I’ll take this silence as a way of saying what I’m trying to achieve here is impossible. In that case, I’ll just make the button spawn the item on top of the player instead

I don’t know what your problem is but if you want to put a string instead of Number, use Change the text of variable
[edit]
Its Change the string of variable for global and scene variable
image
but text for object variable
image

Ooooh, I was trying to get a string with an int variable, and an int with a string variable!
I switched the places of these two, and now it works perfectly!
Thanks ^o^