ID:263969
 
It Says "[usr] took [M]'s type!" 3 times dont know why i have fixed it before but that isnt the only problem, it will not change the players icon..and idk why
mob
verb
Take_Type(mob/M as mob in view(3))
M.loc = locate(usr.lx,usr.ly,usr.lz)
M.icon = 'Kirbys.dmi'
M.icon_state = "nothing"
M.loc = locate(2,2,1)
M.icon = 'Kirbys.dmi'
M.icon_state = ""
usr.icon = 'Kirbys.dmi'
usr.icon_state = "Inflated"
sleep(40)
if("[M.Kirby] == Tornado Kirby")
usr.icon = 'Kirbys.dmi'
usr.icon_state = "tornado kirby"
view() << "[usr] took [M]'s Kirby Type!"
if("[M.Kirby] == Ice Kirby")
usr.icon = 'Kirbys.dmi'
usr.icon_state = "ice kirby"
view() << "[usr] took [M]'s Kirby Type!"
if("[M.Kirby] == Normal")
usr.icon = 'Kirbys.dmi'
usr.icon_state = ""
view() << "[usr] took [M]'s Kirby Type!"

mob/var/Kirby = "Normal"
You are essentially saying
if("Yay, string values!") ==> if(TRUE)


Hint: You do not want the other quote at the end of statement... if you output what you entered, the following will happen:

usr << "[M.Kirby] == Normal" <-- will say '[Kirby value] == Normal'

usr << ("[M.Kirby]" == Normal) <-- will give you a compile time error... unless you #define'd Normal...

usr << ("[M.Kirby]" == "Normal") <-- will say 1 if true (M.Kirby is "Normal"), 0 otherwise

usr << (M.Kirby == "Normal") <-- Samething as above... note the lack of brackets around M.Kirby... it is useless to make something into a string if the value is already a string!


What's with keep redefining the icon?

Also, switch() is a good idea here... you can also put the kirby message after the switch() since you're repeating it in the validation
In response to GhostAnime
thanks..got it workin now