ID:146182
 
Code: Button code
mob
Login()
..()
usr.client.screen += new/obj/button/Info

obj
button
Info
icon = 'Panel icons2.dmi'
icon_state = "Info Open Button"
screen_loc = "9,1"
name = "Info"
MouseEntered()
icon_state = "Info Open Button(I)"
MouseExited()
icon_state = "Info Open Button"
Click()
usr.client.screen += new/obj/button/InfoC
usr.client.screen -= /obj/button/Info
del /obj/button/Info
InfoC
icon = 'Panel icons2.dmi'
icon_state = "Info Close Button"
screen_loc = "9,1"
name = "Info"
MouseEntered()
icon_state = "Info Close Button(I)"
MouseExited()
icon_state = "Info Close Button"
Click()
usr.client.screen += new/obj/button/Info
usr.client.screen -= /obj/button/InfoC
del /obj/button/InfoC


Problem description: When i click on a button the button doesnt dissapear and the new button just appears infront of it.

Replace <code>del /obj/button/Info</code> with <code>del(src)</code>

~~> Dragon Lord
In response to Unknown Person
0.0 i have no explination for me not thinking of that other then im stupid, thank you.
In response to Flame500
In your Login()...I prefer (it's more of a suggestion) to put things on my screen like this:

mob/Login()
..()
new/obj/buttons/asdf(client)


You don't have to listen to me, since this is just a suggestion.