ID:178371
 
Ok first ill go with the trease chest i want to be able to open it and it change icon_state and when its open iwant to beable to search it or close it
and the fishing i want an invisible layer that when i get near it i can fish if i have a fishing rod
For the treasure chest:
obj/chest // Our Chest
icon = 'chest.dmi' // File with Chest images
icon_state = "shut" // Icon State
var/opened = 0 // Is it Opened?
verb
Open()
set src in oview(1) // You have to be next to it
if(opened == 0) // If it hasn't been opened...
icon_state = "open"
opened = 1
/* Do Treasure Stuff Here */
else
src << "This treasure chest has already been opened"
In response to Nova2000
Ok now i need a search and close command for it ( where search takes out the contents or finds it empty) and close( it shuts it)
And the fishing code
In response to Nova2000
obj/chest // Our Chest
icon = 'chest.dmi' // File with Chest images
icon_state = "shut" // Icon State
var/opened = 0 // Is it Opened?
var/found = 0 //Is it found?
verb
Open()
set src in oview(1) // You have to be next to it
if(opened == 0) // If it hasn't been opened...
icon_state = "open"
opened = 1
Search()
set src in oview(1) // You have to be next to it
if(found == 0) //if its 0.. then the treasure is not found!
usr <<"There some treasure here!!"//you found the treasure!
usr.contents += new/obj/treasure //gives the treasure!
found = 1 //so that others can't find the treasure now the treasure founder has it.
else
src << "Nothing in this chest!" //its already been taking so tell the usr theres nothing there!

In response to Charlesisdapimp
obj/chest // Our Chest
icon = 'chest.dmi' // File with Chest images
icon_state = "shut" // Icon State
var/opened = 0 // Is it Opened?
var/found = 0 //Is it found?
verb
Open()
set src in oview(1) // You have to be next to it
if(opened == 0) // If it hasn't been opened...
icon_state = "open"
opened = 1
Search()
set src in oview(1) // You have to be next to it
if(found == 0) //if its 0.. then the treasure is not found!
usr <<"There some treasure here!!"//you found the treasure!
usr.contents += new/obj/treasure //gives the treasure!
found = 1 //so that others can't find the treasure now the treasure founder has it.
else
src << "Nothing in this chest!" //its already been taking so tell the usr theres nothing there!