Apps Home
|
Create an App
Modified Redadice w/Prizes
Author:
iamhd
Description
Source Code
Launch App
Current Users
Created by:
Iamhd
var lastRoller = '--'; var lastArticle = '--'; init(); function init() { cb.changeRoomSubject('Roll the dice (' + cb.settings.tokens + ' per roll). Each result = 1 piece of clothing. If this is still on I take it off or if it is a prize i will do that, if it is already off I put it back on again or if it has already been won then i will stop doing whatever it is'); } cb.onEnter(function (user) { cb.chatNotice('Welcome ' + user['user'] + '!', user['user'], '', '#E31E24', 'bold'); cb.chatNotice('Modified RedaDice game running! Tip ' + cb.settings.tokens + ' to roll the dice. This is like RedaDice only with prizes instead of just clothing also with increased odds of winning', user['user'], '', '#E31E24', 'bold'); cb.chatNotice('Each result = 1 piece of clothing or a prize. If this is still on I take it off or offer a prize, if it is already off or I am already doing something then I put it back on again or stop doing whatever it is I was', user['user'], '', '#E31E24', 'bold'); cb.chatNotice('Tip to keep the game going!', user['user'], '', '#E31E24', 'bold'); }); cb.settings_choices = [ { name: 'tokens', type: 'int', minValue: 1, maxValue: 200, label: 'Cost per Roll (in tokens)', defaultValue: 25 }, { name: 'article1', type: 'str', label: 'Clothing article if 1 is rolled?' }, { name: 'article2', type: 'str', label: 'Clothing article if 2 is rolled?' }, { name: 'article3', type: 'str', label: 'Clothing article if 3 is rolled?' }, { name: 'article4', type: 'str', label: 'Clothing article if 4 is rolled?' }, { name: 'article5', type: 'str', label: 'Clothing article if 5 is rolled?' }, { name: 'article6', type: 'str', label: 'Prize 1?' }, { name: 'article7', type: 'str', label: 'Prize 2?' }, { name: 'article8', type: 'str', label: 'Prize 3?' } ]; cb.onTip(function (tip) { if (parseInt(tip['amount']) >= cb.settings.tokens) { var rolls = Math.floor(parseInt(tip['amount']) / cb.settings.tokens); for (var r = 0; r < rolls; r++) { var dieRoll = Math.floor((Math.random() * 6) + 1); if (dieRoll == 1) prize = cb.settings.article1; if (dieRoll == 2) prize = cb.settings.article2; if (dieRoll == 3) prize = cb.settings.article3; if (dieRoll == 4) prize = cb.settings.article4; if (dieRoll == 5) prize = cb.settings.article5; if (dieRoll == 6) prize = cb.settings.article6; if (dieRoll == 7) prize = cb.settings.article7; if (dieRoll == 8) prize = cb.settings.article8; lastRoller = tip['from_user']; lastArticle = prize; cb.chatNotice(tip['from_user'] + ' rolled :redadie' + dieRoll + ' = ' + prize, '', '', '#E31E24', 'bold'); } cb.drawPanel(); } }); cb.onDrawPanel(function (user) { return { 'template': '3_rows_12_22_31', 'row1_label': 'Last roll by:', 'row1_value': lastRoller, 'row2_label': 'Result:', 'row2_value': lastArticle, 'row3_value': 'Tip to keep game going' }; });
© Copyright Chaturbate 2011- 2026. All Rights Reserved.