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

1 time pickup item. script?


Guest
 Share

Recommended Posts

first sorry for my bad english,

question1…
Hey how i can do that every one can pickup a item on the map 1 time.
I mean, When i am editing the map, i place a item, but i want that this item don't come back if it picked up be any one, and every one can take this item 1 time.

question2...
I place a npc on the map, but i want that if he is killed by any one, it comes not back.
And every one can kill him one time.

Plz help me if it can...
Link to comment
Share on other sites

A better way to do it, is to store things in inis using PutVar and GetVar.

So it checks to see if the player already picked up the item in the ini.

Here's the pseudo(scripted tile):

If GetVar("stuff.ini", player's name, "item") = "" Then
  Give Player Item
  PutVar("stuff.ini, player's name, "item", 1)
  Return
Else
  Print: You already took this item!
  Return
End If

For the other one, you could probably do something like this.

On the OnNpcDeath, do something like this:
Call Putvar("stuff.ini", player's name, npc's number, 1)

Then, on the OnAttack, something like,
If GetVar("stuff.ini", player's name, npc's number) <> "" Then
  Print: You already killed this NPC
  Exit Sub
End If
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...