ID:2127486
 
(See the best response by Phat T.)
Code:
obj
var
song1
Bump(mob/m)
song1
icon='song.dmi'
icon_state="song1"
song1='change1.mid'
density=1


Problem description: How do i get the mob to bump it i tried walking into it wont play the music think im missing a step also tried enter(mob/m)

Best response
here is an example:

var/sound/S = sound('yoursond.wav')
mob
player
Bump(A) //
..()

if(istype(A,/turf/)) // if the player bumps into a turf
var/turf/c = A
if(c.density) // if turf have a density
src << S // play the song

obj
Bump(A) //
..()

if(istype(A,/mob/)) // if the player bumps into a turf
var/mob/c = A
if(c.density) // if turf have a density
c << S


You prob also want if player bumps into an object instead of object bumping into a player
thanks man. my mistake will be used for projectiles in the future
i fixed some mistakes i made and added for objects too
seems my original ideas weren't working because i didn't capitalize the bump lol
mob
Bump(obj)
src<<'change1.mid'