obj/vendingMachine
icon = 'interactables.dmi'
density = 1
icon_state = "vm"
verb
insert_credit()
set src in oview(1)
if(usr.credit =< 0)
Close()
usr << "ding"
usr.give_credit(-1)
var/soda = pick(
/obj/green_soda,
prob(16)
/obj/blue_soda,
prob(16)
/obj/Tele_soda,
prob(16)
/obj/JimSuit_soda,
prob(16)
/obj/RED_soda,
prob(16)
/obj/soda)
new soda(usr.loc)
i have made a credit system but the problem is buying things with negative credits still works, here's a vending machine i tried to stop the usage of 0 or negatives but the things Ive tried either not worked or errored out
|
You may also put in the soda pick as a 'else' condition.