ID:269193
 
i was wonderin how to make an npc stop giving gold.. i have
mob
NPC
icon='person.dmi'
icon_state="cleric_m"
density=1
DblClick()
set src in oview(1)
usr<<"<b><font size=1>Hey there, heres 50 gold."
usr.gold+=50

also i was wonderin how to make him give u an item.. like
mob
NPC
icon='person.dmi'
icon_state="cleric_m"
density=1
DblClick()
set src in oview(1)
usr<<"<b><font size=1>Hey there, heres 50 gold."
usr.gold+=50
//i know it goes here somewhere.. but i dont know hat to put...
well, thanks for reading, and please help me if u can.
There's a number of ways. You could set a var to the mob NPC itself.
mob
NPC
icon='person.dmi'
icon_state="cleric_m"
density=1
DblClick()
set src in oview(1)
if(src.givenoutgold < 10)
usr<<"<b><font size=1>Hey there, heres 50 gold.</b>"
usr.gold+=50
src.givenoutgold ++
else
usr<<"<b><font size=1>I already gave out gold ten times! <i>Possibly not to you, though. Sorry.</i></b>"
var/givenoutgold = 0


Or you could give it to the player's mob.


mob
NPC
icon='person.dmi'
icon_state="cleric_m"
density=1
DblClick()
set src in oview(1)
if(!usr.hasthegold)
usr<<"<b><font size=1>Hey there, heres 50 gold.</b>"
usr.gold+=50
usr.hasthegold = 1
else
usr<<"<b><font size=1>I already gave <i>you</i> some gold!</b>"
Player
var/hasthegold = 0


OR, you could only give it to the player if they have no gold- deny them if they are already loaded.

mob
NPC
icon='person.dmi'
icon_state="cleric_m"
density=1
DblClick()
set src in oview(1)
if(usr.gold == 0)
usr<<"<b><font size=1>Hey there, you're looking a bit poor; heres 50 gold.</b>"
usr.gold+=50
else
usr<<"<b><font size=1>You're damn loaded! You already have <i>[usr.gold]</i>! </b>"



The item thing. Look up usr/src.contents.

mob
NPC
icon='person.dmi'
icon_state="cleric_m"
density=1
DblClick()
set src in oview(1)
usr<<"<b><font size=1>Hey there, heres 50 gold and a small, slightly brittle leaf!"
usr.gold+=50
usr.contents += /obj/leaf

obj
leaf
name = "The uber Leaf of brittleness"

In response to Elation
thank you so much elation!
In response to Oblivon_2
Remember that the gold checking example would say he's loaded if he had minus gold, eg. -10 gold.

Maybe you should change it to usr.gold <= 0.
In response to Elation
okay, everyhtings good except that the item won't show in my inventory...
In response to Oblivon_2
Let's see your tab...thing. Inventory tab. (I need to relearn the terminology.)

Show us the code.
In response to Elation
okay
mob
Stat()
statpanel("Stats")
stat("HP:","[hp]/[maxhp]")
stat("MP:","[mp]/[maxmp]")
stat("Location:","[x]/[y]/[z]")
stat("Level:","[level]")
stat("Experience:","[exp]/[maxexp]")
stat("Strength:","[strength]")
stat("Defense","[defense]")
stat("Intelligence","[intelligence]")
stat("Gold","[gold]")
statpanel("Skills")
stat("Mining","[mine]")
stat("Slashing","[slash]")
stat("Piercing","[pierce]")
stat("Crushing","[crush]")
statpanel("Inventory",usr.contents)
mob
var
hp = 100
maxhp = 100
mp = 50
maxmp = 50
exp = 0
maxexp = 50
level = 0
strength = 5
defense = 3
attacking = 0
gold = 100
intelligence = 5
slash = 0
pierce = 0
crush = 0
mine = 0
hasgold = 0
is that wat u meant?
In response to Oblivon_2
Guh. Silly me, I forgot to *create* the leaf. Try that instead. See the new /obj/leaf.

mob
NPC
icon='person.dmi'
icon_state="cleric_m"
density=1
DblClick()
set src in oview(1)
usr<<"<b><font size=1>Hey there, heres 50 gold and a small, slightly brittle leaf!"
usr.gold+=50
usr.contents += new /obj/leaf

obj
leaf
name = "The uber Leaf of brittleness"
In response to Elation
oh.. lmao, i didnt even notice it! thanks alot man!