#how do i make my gambling script ðŸ˜
1 messages · Page 1 of 1 (latest)
uh
** You are now Level 2! **
i'll rewrite that for you
spoonfeeding
thank you !!
still dont work
I love gambling
what's not working? What's the output? Any prints?
when i click my button nothing happenes
nothing in output
local clickdetector = script.Parent.ClickDetector
local youcanclick = true
local winnoti = workspace.gambling.Winnoti
local noti = workspace.gambling.Noti
local colors = { -- you can put the colors in a table like this
BrickColor.new("Flint"),
BrickColor.new("Pastel Blue"),
BrickColor.new("Bright red"),
BrickColor.new("New Yeller"),
BrickColor.new("Pearl")
}
clickdetector.MouseClick:Connect(function()
if youcanclick then -- this works too and takes up less space
for MyCounter = 1, 5 do -- the default increcement is 1
task.wait(0.1)
noti.BrickColor = colors[math.random(1,#colors)] -- this takes one random color from the table we made, and sets noti's color to it
end
local chance = math.random(1, 100)
if chance >= 60 then
winnoti.BrickColor = colors[1] -- sets winnoti's color to the first color in the same table
elseif chance <= 19 and chance <= 59 then -- use elseif instead of just "if"
winnoti.BrickColor = colors[2]
elseif chance <= 3 and chance >= 18 then
winnoti.BrickColor = colors[3]
elseif chance <= 39 and chance >= 50 then
winnoti.BrickColor = colors[4]
elseif chance <= 0 and chance >= 2 then -- you set the color to bright red in both of these scenarios in your version
winnoti.BrickColor = colors[5]
end
wait(0.2)
-- the "winnoti.BrickColor = BrickColor.new("Pearl") will make the color end up the same everytime
-- ,so we remove that
youcanclick = true
end
end)
one second i forgot to test it
alright it works
if you were trying to make it do something different, tell me
itll be fine thank you sm!!
** You are now Level 1! **
hold up a second
i found an error in the logic
local clickdetector = script.Parent.ClickDetector
local youcanclick = true
local winnoti = workspace.gambling.Winnoti
local noti = workspace.gambling.Noti
local colors = {
BrickColor.new("Flint"),
BrickColor.new("Pastel Blue"),
BrickColor.new("Bright red"),
BrickColor.new("New Yeller"),
BrickColor.new("Pearl")
}
clickdetector.MouseClick:Connect(function()
if youcanclick then
for MyCounter = 1, 5 do
task.wait(0.1)
noti.BrickColor = colors[math.random(1,#colors)]
end
local chance = math.random(1,100)
if chance >= 60 then
winnoti.BrickColor = colors[1]
elseif chance >= 19 and chance <= 59 then
winnoti.BrickColor = colors[2]
elseif chance <= 3 and chance >= 18 then
winnoti.BrickColor = colors[3]
elseif chance <= 17 and chance >= 3 then
winnoti.BrickColor = colors[4]
elseif chance <= 2 then
winnoti.BrickColor = colors[5]
end
wait(0.2)
youcanclick = true
end
end)
now you can gamble properly
@pale plank
^