0% found this document useful (0 votes)
43 views

GUI For Gambling Script

patched

Uploaded by

wyoruu29k
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views

GUI For Gambling Script

patched

Uploaded by

wyoruu29k
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 4

local OrionLib =

loadstring(game:HttpGet(('https://raw.githubusercontent.com/shlexware/Orion/main/
source')))()
local Window = OrionLib:MakeWindow({Name = "Made by Barcode guy Niggas",
HidePremium = false, SaveConfig = true, ConfigFolder = "OrionTest"})

--[[
Name = <string> - The name of the UI.
HidePremium = <bool> - Whether or not the user details shows Premium status or not.
SaveConfig = <bool> - Toggles the config saving in the UI.
ConfigFolder = <string> - The name of the folder where the configs are saved.
IntroEnabled = <bool> - Whether or not to show the intro animation.
IntroText = <string> - Text to show in the intro animation.
IntroIcon = <string> - URL to the image you want to use in the intro animation.
Icon = <string> - URL to the image you want displayed on the window.
CloseCallback = <function> - Function to execute when the window is closed.
]]
local Tab = Window:MakeTab({
Name = "RMA Scripts",
Icon = "rbxassetid://4483345998",
PremiumOnly = false
})

--[[
Name = <string> - The name of the tab.
Icon = <string> - The icon of the tab.
PremiumOnly = <bool> - Makes the tab accessible to Sirus Premium users only.
]]
Tab:AddButton({
Name = "RMA Gamble Script!",
Callback = function()
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local updateremote = ReplicatedStorage:WaitForChild("CustomiseBooth")

-- Symbols for the slot machine


local slotSymbols = {"🍒", "🍋", "🍊", "⭐", "💎"}
local jackpotChance = 0.00001 -- Jackpot chance set to 0.001%

-- Function to update the booth with results


local function updateBoothText(text, imageId)
local success, err = pcall(function()
updateremote:FireServer("Update", {DescriptionText = text, ImageId =
imageId}) -- Include ImageId
end)
if not success then
warn("Failed to update booth text: " .. err)
wait(1) -- Wait a second before restarting if it fails
initializeCasino() -- Restart the casino if tagging occurs
end
end

-- Function to simulate slot machine spin


local function spinSlots()
return slotSymbols[math.random(1, #slotSymbols)], slotSymbols[math.random(1,
#slotSymbols)], slotSymbols[math.random(1, #slotSymbols)]
end

-- Function to update booth text with emojis


local function displaySlotResults(slot1, slot2, slot3, winnings, playerCurrency,
playerName)
local currentBalance = playerCurrency + winnings
if winnings > 0 then
updateBoothText("🎉 Jackpot! Congrats " .. playerName .. "!\n" .. slot1 .. "
| " .. slot2 .. " | " .. slot3 .. "\nYou won " .. winnings .. " coins.\nCurrent
balance: " .. currentBalance .. " coins.")
else
updateBoothText("😢 Sorry " .. playerName .. ", you lost.\n" .. slot1 .. "
| " .. slot2 .. " | " .. slot3 .. "\nBetter luck next time!\nCurrent balance: " ..
currentBalance .. " coins.")
end
end

-- Initialize player currency for each player


local playerCurrencies = {}
local isBetting = false -- Track if a bet is currently in progress
local gamblingActive = true -- Track if gambling is currently active

-- Player bets and spins the slot machine


local function onPlayerBet(player, betAmount)
if not gamblingActive then return end -- Prevent betting if gambling is closed
if isBetting then return end
local playerId = player.UserId
local playerName = player.DisplayName -- Get the player's display name
local playerCurrency = playerCurrencies[playerId] or 100 -- Starting currency
for the player

if playerCurrency >= betAmount and betAmount > 0 then


playerCurrency -= betAmount
playerCurrencies[playerId] = playerCurrency -- Update the player's currency
isBetting = true -- Mark betting in progress

local finalSlot1, finalSlot2, finalSlot3

-- Randomize the slots 5 times


for i = 1, 5 do
local slot1, slot2, slot3 = spinSlots()
updateBoothText(slot1 .. " | " .. slot2 .. " | " .. slot3) -- Show the
random result
wait(0.5) -- Wait briefly before the next spin (0.5 seconds)
if i == 5 then
finalSlot1, finalSlot2, finalSlot3 = slot1, slot2, slot3 -- Save
the final result
end
end

local winnings = 0
local isJackpot = false

-- Check for jackpot


if finalSlot1 == finalSlot2 and finalSlot2 == finalSlot3 then
winnings = math.random(500, 1000) -- Jackpot winnings if all three
slots match
end

-- Add winnings to player's currency after a successful bet


playerCurrency += winnings -- Update the player's currency with winnings
playerCurrencies[playerId] = playerCurrency -- Save updated currency
-- Display the final results without tagging
displaySlotResults(finalSlot1, finalSlot2, finalSlot3, winnings,
playerCurrency, playerName)

wait(3) -- Wait for 3 seconds before allowing the next bet


updateBoothText("🤑 !bet (amount) to play!") -- Reset the booth text
isBetting = false -- Mark betting as finished
elseif betAmount == 0 then
-- No message when betting 0, simply return
else
updateBoothText("❌ Not enough coins! You have " .. playerCurrency .. "
coins.")
wait(3) -- Display for 3 seconds
updateBoothText("🤑 !bet (amount) to play!") -- Reset the booth text after 3
seconds
end
end

-- Player chat handling to place a bet


local function onPlayerChatted(player, message)
local betAmount = tonumber(message:match("^!bet (%d+)$")) -- Detects if the
message is in the format "!bet <amount>"
local endCommand = message:match("^!end gamble$")
local restartCommand = message:match("^!restart gamble$")
local coinsCommand = message:match("^!coins (%S+) (%d+)$") -- Updated to
capture username and amount
local fixCommand = message:match("^!fix$")
local infoCommand = message:match("^!info$")

if betAmount then
onPlayerBet(player, betAmount)
elseif endCommand and player.UserId == 6210009769 then
updateBoothText("🚪 Gambling closing...") -- Updated message
isBetting = false -- Prevent further betting
gamblingActive = false -- Mark gambling as closed
wait(10) -- Allow the message to show for a bit
updateBoothText("🚫 Gambling has been closed.")
elseif restartCommand and player.UserId == 6210009769 then
updateBoothText("🔄 Gambling restarting... Please wait.")
gamblingActive = true -- Allow gambling to restart
initializeCasino() -- Restart the casino
elseif coinsCommand then
local targetUsername, amountStr = coinsCommand:match("^!coins (%S+) (%d+)
$")
local amount = tonumber(amountStr)
if amount then
-- Find the target player by username
local targetPlayer = Players:GetPlayers()
for _, playerInGame in ipairs(targetPlayer) do
if playerInGame.DisplayName:lower() == targetUsername:lower() or
playerInGame.Name:lower() == targetUsername:lower() then
playerCurrencies[playerInGame.UserId] =
(playerCurrencies[playerInGame.UserId] or 0) + amount
updateBoothText("💰 " .. playerInGame.DisplayName .. " has
received " .. amount .. " coins. Current balance: " ..
playerCurrencies[playerInGame.UserId] .. " coins.")
return
end
end
updateBoothText("👤 Player '" .. targetUsername .. "' not found.") --
Player not found
end
elseif fixCommand and player.UserId == 6210009769 then
updateBoothText("🔧 Fixing tagging issues...") -- Optional message while
fixing
wait(1) -- Allow time for the message to show
updateBoothText("🤑 !bet (amount) to play!") -- Reset the booth text
elseif infoCommand and player.UserId == 6210009769 then
isBetting = true -- Pause betting without message
updateBoothText("📜 Made and scripted by barcode guy. Suggestions for
scripts are welcome!", "77372374661565") -- Added image ID here
wait(5) -- Display for 5 seconds
updateBoothText("🤑 !bet (amount) to play!", "") -- Reset the booth text
without image
isBetting = false -- Resume betting
end
end

-- Initialize the casino


local function initializeCasino()
updateBoothText("🤑 !bet (amount) to play!") -- Initial prompt for betting
for _, player in pairs(Players:GetPlayers()) do
playerCurrencies[player.UserId] = 100 -- Initialize currency for existing
players
end
end

-- Connect players to the chat command


Players.PlayerAdded:Connect(function(player)
playerCurrencies[player.UserId] = 100 -- Initialize currency for new players
player.Chatted:Connect(function(message)
onPlayerChatted(player, message)
end)
end)

-- Ensure current players can bet if they are already in the game
for _, player in ipairs(Players:GetPlayers()) do
player.Chatted:Connect(function(message)
onPlayerChatted(player, message)
end)
end

initializeCasino() -- Call the initialize function to start the casino


end
})

--[[
Name = <string> - The name of the button.
Callback = <function> - The function of the button.
]]

You might also like