ID:149197
 
i have jus made an inventory (YAY) and im making it so you can pick up items, which works im jus wondering if theres a way when.
Start again
if you have a CD player in your inventory then when ever you click on a CD (which you also need in your inventary) you get a Listehn to CD, the a switch imput that i kno

-----------
mazarot A.K.A Maz
mob/Stat()
statpanel("items")
stat(usr.contents)

obj/cd
icon = 'cd.dmi'
var/initems = 0//to only let you play the cd IN your inventory
verb
Get()
set src in view(1)
src.Move(usr)
src.initems = 1//its in the inventory
Drop()
src.Move(usr.loc)
src.initems = 0//its out of the inventory

obj/cd
Click()
if(src.initems == 1)//is the cd in the usr's inventory?
usr <<"You play some music!"
src << sound('music.mid',1)
else
usr <<"Pick the item up before you play it."
In response to ShadowSiientx
ok, iv played with it , it doesnt seem to work when i have a CD player and the CD,

This is my items code

obj/items/cdplayer
icon = 'turf.dmi'
icon_state = "player"
var/initems = 0//to only let you play the cd IN your inventory
verb
Get()
set src in view(1)
src.Move(usr)
src.initems = 1//its in the inventory
Drop()
src.Move(usr.loc)
src.initems = 0//its out of the inventory

obj/items/CD
icon = 'turf.dmi'
icon_state = "CD"
var/initems = 0//to only let you play the cd IN your inventory
verb
Get()
set src in view(1)
src.Move(usr)
src.initems = 1//its in the inventory
Drop()
src.Move(usr.loc)
src.initems = 0//its out of the inventory

/obj/items/CD
icon = 'turf.dmi'
icon_state = "CD"
verb/Use_The_CD()

if(usr.initems == 1)//is the cd in the usr's inventory?
//music code.
usr.verbs += /maz/verb/music_on
usr.verbs += /maz/verb/music_off
else
usr <<"You need a CD player to use the CD."


In response to mazarot
fixed it :D yay