ID:1447799
 
(See the best response by Ter13.)
Code:
/obj/item/christmas_horn
name = "Christmas Horn"
desc = "Only on Christmas!"
icon = 'icons/obj/christmas_horn.dmi'

/obj/item/christmas_horn/var/sound(s)
sound('sound/music/Christmas_Horn.wav')


Problem description: I am trying to add sound to this object but, I always get a bad variable definition compile error.

Best response
obj/item/christmas_horn
name = "Christmas Horn"
desc = "Only on Christmas!"
icon = 'icons/obj/christmas_horn.dmi'
proc
playsound(var/mob/m)
range(6,m) << sound('sound/music/Christmas_Horn.wav')


You had a number of syntax issues there.
Thanks a bunch for the help!