Don't attack me. I know I've been asking questions one after another, but...
I am trying to get it where you can wear armor(not for protection, just for looks). You start out with the armor in your inventory, that works. When you select "wear" it says(example): "Phas wears the armor" or say "CoolDude wears the armor". That works. All I need to know is how to change the graphic... I already made them. This is what I tried:
obj/Armor
icon = 'Armor.dmi'
worth = 0
verb/wear()
usr << "[usr] wears the armor."
if [usr] Class == "blackspots" [usr] icon_state == "blackspotswitharmor"
But it doesn't work. Any help here?
ID:174344
![]() Aug 25 2003, 3:12 pm
|
|
![]() Aug 25 2003, 3:15 pm
|
|
Read up on how if()s work.
|
Phas wrote:
Where? The help file confuses me... As it does with many of the new comers to byond. I'll try and explain it a little bit here: if() It's basically used to check IF something is true, false, greater than, equal to, or less than something. Text strings are always true. Here is an example in your case: if(usr.class == "Classhere") usr.icon_state = "SorryIforgotTheState" It doesn't always need 2 arguements (arguements are the things that go in the parenthesis of a proc*) it can sometimes use 1. if(usr.Muted) //Check if the person is muted usr << "You are muted" if(!usr.Muted) usr << "You are not muted <-Airjoe-> * An example of an argument would be: turf/Entered(mob/M) P.S. In an if statement, is something like == 1 or >= 7 and argument? P.S.2. Is argument spelled arguement? @_@ |
Airjoe wrote:
P.S. In an if statement, is something like == 1 or >= 7 and argument? No. It's part of a condition. A condition is a statement like a==6, that tests a value. Lummox JR |
Airjoe wrote:
Phas wrote: Okay, thanks. I'll try that. |
I put:
obj/Armor icon = 'Armor.dmi' worth = 0 verb/wear() usr << "[usr] wears the armor." if(usr.class == "blackspots") usr.icon_state = "blackspotswitharmor" The computer put: NOW I SHALL TERRORIZE YOU WITH MORE ERRORS!!!!!! HAHAHAHAHA!!!(actually, it was: 7 errors (the only one that would show up was Inconsistent indentation) Any help? I've indented so many times, it's not even funny. EDIT: I fixed it somehow. Odd. But now it has one error: usr.class: undefined var ??? |
It means you haven't defined usr.class. Maybe you defined it as usr.Class? Remember most things are CaSe SenSitIVE
~GokuSS4Neo~ |