ID:264054
 
Code:
obj
Hyrule_Temple
icon = 'Hyrule Temple Icon.dmi'
icon_state = "Stage 1"
New(client/c)
screen_loc="5,14"
c.screen+=src
Click()
for(var/obj/T in usr.client.screen)
world << "[usr] has joined the clash in the hyrule temple."
usr.hyruletemple = 1
usr.loc = locate(11,14,1)
del(T)

obj
Lylat_Cruise
icon = 'Hyrule Temple Icon.dmi'
icon_state = "Stage 2"
New(client/c)
screen_loc="6,14"
c.screen+=src

Click()
for(var/obj/T in usr.client.screen)
world << "[usr] has joined the clash on Lylat Cruise."
usr.loc = locate(56,10,1)
del(T)//deletes them
return


Problem description: I'm trying to get both of these codes so that when you click on the icon it teleports you to the destination then deletes all the huds on the screen. All help appreciated. Thanks.

~Element Hero creator

Please read and fix obvious mistakes in your code first. You've got things like the loc setting and message output inside the loop, and return at its end which will make it not 'delete multiple huds' at once because the procedure returns after 1 iteration of the loop.

Anyway, something you could do to get this effect is just set the screen variable to null or empty list, if you're sure you want to remove everything from it.
In response to Kaioken
I tried changing the screen variable, it said screen undefined var, when I put screen = null
In response to Element Hero creator
This might be because screen is a client variable.
In response to Kaioken
Yes! I finnaly got it working. Thanks.