Apps Home
|
Create an App
Roll&Show
Author:
hoodie90
Description
Source Code
Launch App
Current Users
Created by:
Hoodie90
// Roll & Show // December 2015 var lastRoller = '--'; var lastArticle = '--'; init(); function init() { cb.changeRoomSubject('RollnShow game running! Roll the dice (' + cb.settings.tokens + ' per roll). Each result = flash a body part or remove a piece of clothing. If the body part is already exposed then play with it for 10secs. If the clothing is already off, put it back on!'); } cb.onEnter(function (user) { cb.chatNotice('Welcome ' + user['user'] + '!', user['user'], '', '#E31E24', 'bold'); cb.chatNotice('RedaDice game running! Tip ' + cb.settings.tokens + ' to roll the dice.', user['user'], '', '#E31E24', 'bold'); cb.chatNotice('Each result = flash a body part or remove a piece of clothing. If the body part is already exposed then play with it for 10secs. If the clothing is already off, put it back on!', 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: 'Body part if 4 is rolled?' }, { name: 'article5', type: 'str', label: 'Body part if 5 is rolled?' }, { name: 'article6', type: 'str', label: 'Body part if 6 is rolled?' } ]; 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; lastRoller = tip['from_user']; lastArticle = prize; cb.chatNotice(tip['from_user'] + ' has rolled a :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.