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

Anything wrong with this?


Murdoc
 Share

Recommended Posts

```
If CanTake(Index, 1, 1) = true And CanTake(Index, 2, 1) = true And CanTake(Index, 3, 1) = true Then

Call PlayerMsg(index, "Here is the item4 I promised!", 12)
Call TakeItem(index, 1, 1)
Call TakeItem(index, 2, 1)
Call TakeItem(index, 3, 1)
Call GiveItem(index, 4, 1)

Else

Call PlayerMsg(index, "Bring me an item1, item2 and item3 and I'll make you an item4!", 12)

End If
```
It's supposed to be a scripted npc that checks for 3 different items, and if you have them you get another item. I'm pretty new at scripting, so I'll be surprised if it's totally right…
Link to comment
Share on other sites

Try:

> If CanTake(Index, 1, 0) = True And CanTake(Index, 2, 0) = True And CanTake(Index, 3, 0) = True Then
> Call PlayerMsg(Index, "Here is the item4 I promised!", 12)
> Call TakeItem(Index, 1, 1)
> Call TakeItem(Index, 2, 1)
> Call TakeItem(Index, 3, 1)
> Call GiveItem(Index, 4, 1)
> Else
> Call PlayerMsg(Index, "Bring me an item1, item2 and item3 and I'll make you an item4!", 12)
> End If

Regards,
  Godlord.
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...