Gambling Script
Gambling Script
local winnings = 0
local isJackpot = false
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("🤑 Place !bet (Amount) to gamble!") -- 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("🤑 Place !bet (Amount) to gamble!", "") -- Reset the booth
text without image
isBetting = false -- Resume betting
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