ID:172340
 
Hey, how can u make a kareokee machine in a game? What would the code look like? I tried making one, ut failed...
Also, how would u make a turf that when stepped on a odd number of times, it plays one song, stepped on an even number of times, it plays another song?
Pika123 wrote:
Hey, how can u make a kareokee machine in a game? What would the code look like? I tried making one, ut failed...

Example:
mob/verb/kareokeemachine()
var/choice=input("Play what song?","Song Choice") in list("Linkin Park", "Disturbed", "Good Charolotte")
switch(choice)
if("Linkin Park")
usr<<sound('Linkin Park.wav')
if("Disturbed")
usr<<sound('Disturbed.wav')
if("Good Charolotte")
usr<<sound('Good Charolotte.wav')


Or, they can choose from their computer:

mob/verb/kareokeemachine2(s as sound)
usr<<sound(s)


Also, how would u make a turf that when stepped on a odd number of times, it plays one song, stepped on an even number of times, it plays another song?

Another example:

mob/var/steppedonturf=0

turf/blahblah
icon='blah.dmi'
Entered(mob/M)
if(M.steppedonturf==5)//change to whatever times
M<<sound('songhere.wav')
if(M.steppedonturf==10)//change to whatever times
M<<sound('songhere.wav')
else
M.steppedonturf++