Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

A Quick Question (SOLVED)


Kimimaru
 Share

Recommended Posts

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

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

@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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...