ID:270077
 
mob/var/equiped = 0//Make an equiped variable, and make it so nothing is equiped when they start out

obj/baton





Weapon
icon = 'Weapon.dmi'
icon_state = "baton"
density = 0


verb
Equip()//Equip verb
if(usr.equiped == 0)//If nothings equiped..
usr.Strength += 3//Give them more strength!
usr.Defense +=1
usr.equiped = 1//Make it so something is equiped
usr << "You wield the [src]!."//Tell them they equiped it
view() << "\blue [usr] equips the [src]!"//Tell everyone in view it happened
suffix = "(Equiped)"//Show thats its equiped in youre inventory
else//If they do have something equiped tell them...
usr << "You already have something equiped!"
Un_Equip()
if(usr.equiped == 1)//If it is equiped
usr.Strength -= 3//Take away the strength
usr.equiped = 0//Make it so they can equip it again later
usr << "You Unequip your baton."//Tell them they un equiped it
view() << "\blue [usr] un-equips the [src]!"//Tell everyone in view it happened
suffix = null//Make it so it doesnt say its equiped anymore
else//Just like earlier, except it they have nothing equiped
usr << "You dont have anything wielded."


obj
verb/Get()//Pick objects up!
set category = "Other"
set src in oview(0)
src.loc = usr
view() << "[usr] picks up the [src]"





obj/knife
weapon//next weapon
icon = 'Weapon.dmi'
icon_state = "knife"
density = 0


verb
Equip()//Equip verb
if(usr.equiped == 0)//If nothings equiped..
usr.Strength += 4//Give them more strength!
usr.Defense +=1
usr.equiped = 1//Make it so something is equiped
usr << "
You wield the [src]!."//Tell them they equiped it
view() << "\blue [usr] equips the [src]!"//Tell everyone in view it happened
suffix = "(Equiped)"//Show thats its equiped in youre inventory
else//If they do have something equiped tell them...
usr << "You already have something equiped!"
Un_Equip()
if(usr.equiped == 1)//If it is equiped
usr.Strength -= 4//Take away the strength
usr.equiped = 0//Make it so they can equip it again later
usr << "You Unequip your knife."//Tell them they un equiped it
view() << "\blue [usr] un-equips the [src]!"//Tell everyone in view it happened
suffix = null//Make it so it doesnt say its equiped anymore
else//Just like earlier, except it they have nothing equiped
usr << "You dont have anything wielded."

obj
verb/Get()
set category = "Other"
set src in oview(0)
src.loc = usr
view() << "[usr] picks up the [src]"






This is my code for two weapons.When i compile there is a duplicate and previous error with the verb get.Is there a way to fix this because i dont want to have to use different code file for every weapon.
See [link].

[edit]
Also, realize that the best comments tell -why- a line of code is doing whatever it's doing: not simply what it's doing. Of course, that doesn't mean that you shouldn't comment on -what- a line of code is doing when it isn't immediately clear. In any case, there's no reason to comment every line of code: it's a waste of your time, and it actually makes the code less readable by making it look cluttered.

On that note, when code shares the same line with its comment, you should put a tab's length in between to ensure readability.
In response to Wizkidd0123
.................ok thanks for the help
In response to Dragon_fire6653
that was kinda confusing to understand since i am a begginer at coding...............
In response to Dragon_fire6653
could you re explain it in a more understanding way?
In response to Dragon_fire6653
I'll explain you your mistake. You freaking copy/pasted all.