forked from iCoderXvn/BCgameScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsimple.js
More file actions
28 lines (24 loc) · 654 Bytes
/
simple.js
File metadata and controls
28 lines (24 loc) · 654 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
var config = {
bet: { label: 'Bet', value: 10, type: 'number' },
payout: { label: 'Payout', value: 1.3, type: 'number' },
}
var lastPayout = 0;
var bet = config.bet.value;
var payout = config.payout.value;
function main() {
Bet(bet, payout);
}
function Bet(bet, payout) {
game.onBet = function() {
lastPayout = game.bet(bet, payout).then(function(payout) {
if (payout > 1) {
log.success("We won, payout " + payout + "X!");
return 1;
} else {
log.error("We lost, payout " + payout + "X!");
return 0;
}
});
log.error(payout);
};
}