obj
sword
icon='items.dmi'
verb
Get()
set src in oview(1)
usr.contents += src
view() << "[usr] picks up \a [src]"
Drop()
new/obj/sword(usr.loc)
view() << "[usr] drops \a [src]"
del(src)
Equip()
if(usr.weapon_equipped == 0)
usr.weapon_equipped=1
view() << "[usr] equips a sword."
usr.overlays+='items.dmi'
usr.verbs+=/mob/attack/verb/Slash()
else
usr << "You are already wielding something."
Unequip()
if(usr.weapon_equipped == 1)
usr.weapon_equipped=0
view() << "[usr] unequips a sword."
usr.overlays-='items.dmi'
usr.verbs-=/mob/attack/verb/Slash()
else
usr << "You aren't wielding this."
Thats my item code i want the usr to be added the verb Slash when they equip and then lose it when they unequip
ID:266414
![]() Mar 4 2002, 6:59 am
|
|
![]() Mar 4 2002, 8:34 am
|
|
plz help
|
do this, instead of using + and - for the verbs, use Add() and Remove()
(btw, tabs are not in place as Tab changes the selected items when not used in a word processor) Equip() if(usr.weapon_equipped == 0) usr.weapon_equipped=1 view() << "[usr] equips a sword." usr.overlays+='items.dmi' usr.verbs.Add(/mob/attack/verb/Slash()) else usr << "You are already wielding something." Unequip() if(usr.weapon_equipped == 1) usr.weapon_equipped=0 view() << "[usr] unequips a sword." usr.overlays-='items.dmi' usr.verbs.Remove(/mob/attack/verb/Slash()) else usr << "You aren't wielding this." |
you can do it both the way you had it and the way that one dude had it but you have to remove the "()" from behind the verb or else it will think you are trying to call it.
|
that didnt work i get
runtime error: Cannot read null.HP proc name: Slash (/mob/attack/verb/Slash) source file: aoftmsf.dm,207 usr: DBZFreak (/mob/man) src: null call stack: Slash(null) the sword (/obj/sword): Equip() runtime error: wrong type of value for list proc name: Equip (/obj/sword/verb/Equip) source file: aoftmsf.dm,174 usr: DBZFreak (/mob/man) src: the sword (/obj/sword) call stack: the sword (/obj/sword): Equip() |