ID:263107
 
Code:
    castle24
icon = 'castle.dmi'
icon_state="24"
density = 1
name = "Castle"
Enter()
if(usr.stars==10)
usr.castlep=1
usr<<"congrulations you are know able to enter my castle."
icon_state="28"
castle25
icon = 'castle.dmi'
icon_state="25"
density = 1
name = "Castle"
Enter()
if(usr.stars==10)
usr.castlep=1
usr<<"congrulations you are know able to enter my castle."
icon_state="29"
castle26
icon = 'castle.dmi'
icon_state="26"
density = 1
name = "Castle"
Enter()
if(usr.stars==10)
usr.castlep=1
usr<<"congrulations you are know able to enter my castle."
icon_state="27"


Problem description:
the problem is i dont get how to make it so that when somen enters one of those icons the other icons change icon states i tried this but gave me errors.dont worry about spacing.
    castle24
icon = 'castle.dmi'
icon_state="24"
density = 1
name = "Castle"
if(usr.castlep=1)
icon_state="28"
Enter()
if(usr.stars==10)
usr.castlep=1
usr<<"congrulations you are know able to enter my castle."
icon_state="28"
castle25
icon = 'castle.dmi'
icon_state="25"
density = 1
name = "Castle"
if(usr.castlep=1)
icon_state="29"
Enter()
if(usr.stars==10)
usr.castlep=1
usr<<"congrulations you are know able to enter my castle."
icon_state="29"
Well, for starters, you can look ep Enter(). You are using it way wrong. Then, you can look up Entered() and figure out how to use that. It's what you need. And remember to call ..() after you change the icon.
You need to define whose icon_state has to change. If you want the castle's icon_state to change you need <code>src.icon_state="whatever"</code>.

If you want the mob's icon_state to change you need <code>usr.icon_s----</code> - Hold it! Bzzzt, unrobust code!

turf/someturf
Enter()
usr<<"entered!"

...is wrong. Don't use usr in Enter(), you need something more robust. Like:
turf/someturf
Enter(mob/M)
if(!ismob(M))return 0
M<<"entered in a robust way!"



...So if you want the mob's icon_state to change, use <code>M.icon_state=""</code>.

O-matic
In response to O-matic
i dont want the mobs icon to change i want when a player enters one of the three turfs i have there all three turfs change icon state to another icon state.
In response to Hey says hey
var/entered
turf
thingy
Entered(mob/M)
if(!istype(M)) return
entered++
if(entered==3) for(var/turf/thingy/a in world) a.icon_state="secondstate"
In response to Mysame
thanks that worked.