ID:1431970
 
(See the best response by Nadrew.)
Code:
mob/var/current_action

obj/tree_bottom/verb/cut()
set src in view(usr,1)
if(usr.current_action)
usr << "You're already doing something!"
return
usr.current_action = "chopping a tree down"
// This could be more robust, but this is just an example...
spawn(50)
if(usr.current_action == "chopping a tree down")
usr << "You have chopped the tree down!"
usr.current_action = null


I am trying to get the icon of a tree to disappear after the action is completed via the code above and I cant figure out how to make the tree disappear after this is completed successful

Best response
Well, it depends on what you want to do. Do you want the tree to be gone forever (at least until the game restarts) or do you want it to come back after a time?

If you want it gone you just have to do:

del(src)


Where you want it gone.

If you want it to disappear then come back after a while:

src.invisibility = 101
spawn(100) src.invisibility = 0


Setting density and whatnot as well of course.