aisdjioad
Member
So i'm just trying to make a "pick item" system script, but it's not working at all.
I have some global variables named: global.InvSlot0, global.Invslot1, 2, 3, 4, 5. (these are the slots in my inventory).
And another global variable named: global.currentInvSlot = [global.InvSlot0, global.Invslot1, 2, 3, 4, 5]
So this is the code:
function scrItemGet(_iid) ///_iid is the item id.
{
for (var i = 0; i < 5; i++)
{
var _check = global.currentInvSlot;
if (_check == 0)
{
global.currentInvSlot = _iid;
return true;
}
}
}
But when i try to pick up the item, nothing happens...
I open my inventory and the item is not there.
Theres something wrong with my code?
I have some global variables named: global.InvSlot0, global.Invslot1, 2, 3, 4, 5. (these are the slots in my inventory).
And another global variable named: global.currentInvSlot = [global.InvSlot0, global.Invslot1, 2, 3, 4, 5]
So this is the code:
function scrItemGet(_iid) ///_iid is the item id.
{
for (var i = 0; i < 5; i++)
{
var _check = global.currentInvSlot;
if (_check == 0)
{
global.currentInvSlot = _iid;
return true;
}
}
}
But when i try to pick up the item, nothing happens...
I open my inventory and the item is not there.
Theres something wrong with my code?