I was working on a random loot box system I had it working, but when I got back on I stopped working and said this in the output "ServerScriptService.InteractionHandlers.BuyShopItem:39: invalid argument #2 to 'random' (interval is empty) - Client - Purchaser:17"
local plr = game.Players.LocalPlayer
local debounce = false
script.Parent.MouseButton1Click:connect(function()
-- Prevent multiple clicks
if not debounce then
debounce = true
-- Play sound
plr.PlayerGui.GUIClick:Play()
-- Send message to server to purchase
script.Parent.Text = ". . ."
local result = game.ReplicatedStorage.Interactions.Server.BuyShopItem:InvokeServer(script.Parent.Case.Value)
-- Show result
script.Parent.Text = result
if result == "SUCCESS" then
script.Parent.Parent.Parent.Visible = false
elseif result == "CAN'T AFFORD" then
plr.PlayerGui.MainGui.Shop.PurchaseFail.TimePosition = 0.4
plr.PlayerGui.MainGui.Shop.PurchaseFail:Play()
plr.PlayerGui.MainGui.BuyCoins.Visible = true
plr.PlayerGui.MainGui.BuyCoins.CameFromShop.Value = true
plr.PlayerGui.MainGui.Shop.Visible = false
script.Parent.TextColor3 = Color3.fromRGB(255, 0, 0)
else
plr.PlayerGui.MainGui.Shop.PurchaseFail.TimePosition = 0.4
plr.PlayerGui.MainGui.Shop.PurchaseFail:Play()
script.Parent.TextColor3 = Color3.fromRGB(255, 0, 0)
wait(2)
end
script.Parent.Text = "BUY"
script.Parent.TextColor3 = Color3.fromRGB(255, 255, 255)
debounce = false
end
end)

2 comments
Fixed code block
When making answers/questions you need to be more descriptive!