ID:142936
 

mob/verb/Choose_Drink(){var/drink = pick("Rum","Vodka","Beer");src<<"You got [drink]!"}

got this from another coder but i dont understand how to make it do 2 at once


mob/verb/Choose_Drink(){var/drink = pick("Rum","Vodka","Beer")var/drink2 = pick("shot","glass","double shot");src<<"You must drink a [drink2] of [drink]!"}

attempted this but i get
:error: var: expected end of statement

mob
verb/Choose_Drink()
var/drink = pick("Rum","Vodka","Beer")
var/drink2 = pick("shot","double shot","glass");src<<"You [drink2] of [drink]!"



this is what i have now im still a noob at this stuff this is working but im sure its still not right how can i make it prettY?
In response to Bluntmonkey
No line has to be on the same line as any other line, and as long as there isn't a good reason (trying to compact or obfuscate code) it's best to spread out code as much as possible.
mob
verb/Choose_Drink()
var
drink = pick("Rum","Vodka","Beer")
drink2 = pick("shot","double shot","glass")
src << "You drink a [drink2] of [drink]!"

If that's what you mean by pretty, then OK. Otherwise, what do you mean by 'pretty'?
In response to Hazman
thats great one more thing how would i make a probability added? like say i wanted rum to come up 25% more times than the others?
In response to Bluntmonkey
You can do this by using pick() in the form pick(Probability;value,Probability;value) i.e.
var/drink = pick(125;"Rum",100;"Vodka",100;"Beer")