Kimimaru Posted July 18, 2009 Author Share Posted July 18, 2009 Hey! I'm currently making a scripted tile that warps you to another spot and gives you an item when you step on it. It works, but I'm trying to modify it to make it so that it looks for the earliest inventory slot to place the item in. Here's what I have so far, and I know it's wrong:```' Warps player and gives them an item Tile Case 2 Dim i For i = 1 to 24 Call GetPlayerInvItemNum(Index, i) If GetPlayerInvItemNum(Index, i) = False Then Call setplayerinvitemnum(index, i, 2) End If Next i```I'm attempting to use the FOR statement to search for the inventory slot and then put the item in the first available inventory slot. Any help would be greatly appreciated. Link to comment Share on other sites More sharing options...
Patrick Posted July 18, 2009 Share Posted July 18, 2009 Just make it so it keeps on checking for each one if an item is there and if there isn't then place it there. Link to comment Share on other sites More sharing options...
Kimimaru Posted July 18, 2009 Author Share Posted July 18, 2009 That's what I'm trying to do, but I don't know the correct way of doing it. Plus, I want to place the item only in one of the slots. Link to comment Share on other sites More sharing options...
Admiral Refuge Posted July 18, 2009 Share Posted July 18, 2009 Why not just install Godlord's Inventory subs, and use:Call GiveItem(Index, itemnumber, dura)?Either way, I think the syntax for the for loop (having an "i" after Next) may be off, as well as the return value for GetPlayerInvItemNum, not sure if it returns a bool or not; meh, what do I know; check and see how Godlord did it XD Link to comment Share on other sites More sharing options...
Kimimaru Posted July 18, 2009 Author Share Posted July 18, 2009 Okay, thanks, but if I don't have a duration for my item, what do I do? Shouldn't I just exclude the last part by only having 1 separator? I do have Godlord's Inventory Script installed, by the way. Link to comment Share on other sites More sharing options...
Admiral Refuge Posted July 18, 2009 Share Posted July 18, 2009 @Kimimaru:> Okay, thanks, but if I don't have a duration for my item, what do I do? Shouldn't I just exclude the last part by only having 1 separator? I do have Godlord's Inventory Script installed, by the way.You mean your item is set to indestructible? The dura would be -1 in that case. Link to comment Share on other sites More sharing options...
Kimimaru Posted July 18, 2009 Author Share Posted July 18, 2009 Okay, thanks a lot once again! I have to find out a way to repay you. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now