This script should give the player rocks or paper or print nothing but for some reason its only giving rocks and not paper or print nothing. i even pressed the button 1000 times and i got 289 rocks 0 papers no got nothing in output. heres the script
local mainGui = script.Parent.Parent.Parent
local itemButton = script.Parent
local moneyHandler = game:GetService("ReplicatedStorage"):WaitForChild("MoneyHandler")
local inventory = mainGui.Inventory
local player = game.Players.LocalPlayer
local leaderstats = player:WaitForChild("leaderstats")
local money = leaderstats:WaitForChild("Money")
itemButton.MouseButton1Up:Connect(function()
local randomNumber = math.random(1,100)
if randomNumber <= 35 then
local rarityItem = math.random(1, 100000)
if rarityItem <= 45000 then
local commenItem = math.random(1,10)
if commenItem == 1 or 2 or 3 or 4 then -- I do get rocks
local amountGettingItemRock = math.random(1,100)
if amountGettingItemRock <= 70 then
inventory.ItemsScrollingFrame.Rock.AmountItem.Value += 1
elseif amountGettingItemRock <= 94 then
inventory.ItemsScrollingFrame.Rock.AmountItem.Value += 2
elseif amountGettingItemRock <= 100 then
inventory.ItemsScrollingFrame.Rock.AmountItem.Value += 3
end
elseif commenItem == 5 or 6 or 7 then -- but no paper
local amountGettingItem = math.random(1,100)
if amountGettingItem <= 70 then
inventory.ItemsScrollingFrame.Paper.AmountItem.Value += 1
elseif amountGettingItem <= 94 then
inventory.ItemsScrollingFrame.Paper.AmountItem.Value += 2
elseif amountGettingItem <= 100 then
inventory.ItemsScrollingFrame.Paper.AmountItem.Value += 3
end
elseif commenItem == 8 or 9 or 10 then
print("got nothing") -- and I also dont get this message
end
end
elseif randomNumber >= 36 then
print("Dint get reaction") -- I do get this in the chat
end
end)
can someone please help me?