Random - Roblox Beginners Scripting Tutorial #15 (2024)

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 ธ.ค. 2024

ความคิดเห็น • 357

  • @SkullsDev
    @SkullsDev 5 หลายเดือนก่อน +111

    RNG games: WRITE THAT DOWN! WRITE THAT DOWN!

    • @TropialGamingYT
      @TropialGamingYT 4 หลายเดือนก่อน +1

      real

    • @atotallylazyperson
      @atotallylazyperson 4 หลายเดือนก่อน +8

      devs fr boutta
      local nochance = math.random(1, 1000000)
      if nochance == 1 then
      - - get really good aura script here
      end

    • @BlueTheCrew
      @BlueTheCrew 3 หลายเดือนก่อน +2

      @@atotallylazyperson really bad aura*

    • @atotallylazyperson
      @atotallylazyperson 3 หลายเดือนก่อน +4

      @@BlueTheCrew oh yeah mb

    • @SimplyTutuco
      @SimplyTutuco 2 หลายเดือนก่อน +1

      @@atotallylazyperson more like this:
      local defaultCommonChance = math.random(1,2)
      if defaultCommonChance == 69 then
      insert default aura creation script here
      end

  • @hechiv6085
    @hechiv6085 5 หลายเดือนก่อน +49

    Woah woah, slow down with the upload speed fam. I'm still practicing the previous guide🗿(I appreciate the tutorials🙏. Also, you're really good at simplifying and explaining the concepts.)

  • @Jundazz
    @Jundazz 4 หลายเดือนก่อน +43

    local pet = math.random(1, 5)
    if pet == 1 then
    print("You got a cat")
    elseif pet == 2 then
    print("you got dog")
    else
    print("you got unlucky and your pet didnt hatch")

    end
    simple pet opening

    • @MeowToonYT
      @MeowToonYT 27 วันที่ผ่านมา +3

      Pet sim in a nutshell

    • @ZoneBlox
      @ZoneBlox 9 วันที่ผ่านมา

      ​@@MeowToonYT--[[Wrong there is the code]]
      Local pet = math.random(1, 10)
      If pet = 9.7 then
      Print("you got below normal")
      If pet >=9.9 then
      Print ("you got normal")
      If pet >=9.99 then
      Print("you got mythical")
      If pet>= 9.99999 then
      Print("you got huge")

    • @janjaap58
      @janjaap58 7 วันที่ผ่านมา

      I don't think that will work cuz it doesn't make decimal numbers.​@@ZoneBlox

  • @Mr.Pegumin
    @Mr.Pegumin 5 หลายเดือนก่อน +15

    some of the best underatted script teaching channel man. keep up the good work!

  • @osakadev
    @osakadev 5 หลายเดือนก่อน +29

    Summary (I was sleeping)
    math.random() is a function which generates pseudo-random numbers within the range of the first parameter and the second
    More data:
    - If you do not pass parameters, math.random() will generate numbers from 0 to 1
    - If the parameter a is greater than the parameter b, then an error will be thrown (and also if b is less than a)
    Examples of math.random()
    - Get a random element from a table:
    local numbers = {1, 2, 3, 4, 5, 6}
    print(numbers[math.random(1, #numbers)] -- print a random number inside the table!
    By the way, results of math.random() are going to depend on math.randomseed()

    • @reaklaz
      @reaklaz 5 หลายเดือนก่อน +2

      is he feeding you? cuz i see you on every video

    • @osakadev
      @osakadev 5 หลายเดือนก่อน +1

      @@reaklaz i'm his helper

    • @jvdeonyourblock
      @jvdeonyourblock 4 หลายเดือนก่อน +2

      @@osakadev what does the "pseudo" mean

    • @jvdeonyourblock
      @jvdeonyourblock 4 หลายเดือนก่อน +1

      also your comments are really helpful, thanks

    • @osakadev
      @osakadev 4 หลายเดือนก่อน +2

      @@jvdeonyourblock pseudorandom in this case, means "numbers NOT REALLY random", cuz computers cannot generate real random numbers

  • @AFMrPink
    @AFMrPink หลายเดือนก่อน +6

    I used some of the code taught so far
    local function RNG()
    local randomNumber = math.random(1, 1000)
    if randomNumber 800 and randomNumber 900 and randomNumber 950 and randomNumber 975 and randomNumber 990 and randomNumber

    • @grainter5
      @grainter5 28 วันที่ผ่านมา

      Here's a tip: every time your function loops, it'll be a few miliseconds off because of the way you wrote it. Don't ask me why, i don't know. But if you wanna fix it you can instead put all the code inside that function, inside the while true do loop. And here's another tip: don't put "task.wait(whatever number here)" inside a while true loop if you wanna wait until it loops again, instead just type "while task.wait(some number here) do" and it'll do the same.

  • @Strange_occurance
    @Strange_occurance หลายเดือนก่อน +3

    these tutorials are really helpful

  • @z1ngetsuu
    @z1ngetsuu 2 หลายเดือนก่อน +3

    (speed orb that gives you 5 toalkspeed. and the orb is also randomly changing colors)
    local toggle = false
    script.Parent.Touched:connect(function(hit)
    local cooldown = (3)
    local duration = (10)
    local randomNumber = math.random(5, 20)
    local part = script.Parent
    if toggle == false then
    if hit.Parent:FindFirstChild("Humanoid") then
    toggle = true
    part.Transparency = 1
    part.CanTouch = false
    part.CanCollide = false
    hit.Parent.Humanoid.WalkSpeed = hit.Parent.Humanoid.WalkSpeed + randomNumber
    print(randomNumber)
    wait(cooldown)
    part.Transparency = 0.2
    part.CanTouch = true
    part.CanCollide = true
    toggle = false
    end
    end
    end)
    while true do
    local part = script.Parent
    local redValue = math.random(0, 255)
    local greenValue = math.random(0, 255)
    local blueValue = math.random(0, 255)
    part.Color = Color3.fromRGB(redValue, blueValue, greenValue)

    task.wait(0.2)
    end

  • @CloudKicks.official
    @CloudKicks.official 4 หลายเดือนก่อน +1

    thank you very much bro. i have watched more than 100 tutorials but yours hit different i understood everything. and everything worked even doin it by my self. i cant really tell you how much i appreciate. thank you!!!

  • @LavaWander
    @LavaWander 5 หลายเดือนก่อน +15

    I used some of my GUI knowledge and made a button that rolls a die. This is the script I put inside it.
    local roll = script.Parent
    roll.MouseButton1Click:Connect(function()
    local result = roll.Parent:FindFirstChild("Result")
    local rolled = math.random(1, 6)

    if rolled == 1 then
    result.TextColor3 = Color3.fromRGB(255, 0, 0)
    elseif rolled == 6 then
    result.TextColor3 = Color3.fromRGB(0, 255, 0)
    else
    result.TextColor3 = Color3.fromRGB(0, 0, 255)
    end

    result.Text = "ROLLED: " .. rolled
    end)

    • @JustASimpleMan07
      @JustASimpleMan07 หลายเดือนก่อน

      "MouseButton1Click" is not even a thing?

    • @LavaWander
      @LavaWander หลายเดือนก่อน

      @JustASimpleMan07 It has minor differences to "Activated"

  • @Sky_Blue_Crew
    @Sky_Blue_Crew 4 หลายเดือนก่อน +2

    This is an episode I've been waiting for, its perfect for my script random color script, so here is:
    --set variable
    local partTouched = false
    local RandomCounter = 1
    --random color loop
    script.Parent.Touched:Connect(function(part)

    if partTouched == false then
    local humanoid = part.Parent:FindFirstChild("Humanoid")
    if humanoid then
    partTouched = true
    while RandomCounter

  • @goofymctooty3650
    @goofymctooty3650 3 หลายเดือนก่อน +8

    Ive gone from nothing to learing how to give my friends a gambling addiction thanks man

  • @RubickO7
    @RubickO7 4 หลายเดือนก่อน +5

    local Rarity = math.random(1, 5)
    if Rarity == 1 then
    print("you got uncommon")

    elseif Rarity == 2 then
    print("common")
    elseif Rarity == 3 then
    print("rare")
    elseif Rarity == 4 then
    print("legendary")
    elseif Rarity == 5 then
    print("limited")
    end
    print(Rarity)

    • @KaYi25
      @KaYi25 3 หลายเดือนก่อน +8

      doesnt make sense to add rarities if all the values have the same chance of being chosen.

    • @retroAIO
      @retroAIO 2 หลายเดือนก่อน

      @@KaYi25fr

  • @janjaap58
    @janjaap58 7 วันที่ผ่านมา +2

    I tried to make 1 out of 3 blocks get a random color if you touch the Big part
    local P1 = game.Workspace.P1
    local P2 = game.Workspace.P2
    local P3 = game.Workspace.P3
    local P4 = game.Workspace.P4
    local SafetyFeature = false
    P1.Touched:Connect(function(GH)
    local touch = GH.Parent:FindFirstChild("Humanoid")
    if touch and SafetyFeature == false then
    SafetyFeature = true
    local N1 = math.random(1, 3)
    print(N1)
    local red = math.random(0, 255)
    local green = math.random(0, 255)
    local blue = math.random(0, 255)
    if N1 == 1 then
    P2.Color = Color3.fromRGB(red, green, blue)
    end
    if N1 == 2 then
    P3.Color = Color3.fromRGB(red, green, blue)
    end
    if N1 == 3 then
    P4.Color = Color3.fromRGB(red, green, blue)
    end
    wait(1)
    SafetyFeature = false
    end
    end)

    • @maxinkowski4845
      @maxinkowski4845 16 ชั่วโมงที่ผ่านมา

      Very creative but what does GH mean?

    • @janjaap58
      @janjaap58 8 ชั่วโมงที่ผ่านมา

      @@maxinkowski4845 its just random numbers from my keyboard it is a variable and doesn't have a specific meaning on my case.

    • @janjaap58
      @janjaap58 8 ชั่วโมงที่ผ่านมา

      Correct me if I'm wrong btw

  • @Titananderson
    @Titananderson 12 วันที่ผ่านมา +1

    local function petGamble()
    while true do
    task.wait(1)
    local gambling = math.random(1, 20)
    if gambling == 1 then
    print("you got a dragon!")
    elseif gambling

  • @cobyjacob2054
    @cobyjacob2054 4 หลายเดือนก่อน +5

    -- function that prints the name of a certain world type
    local function randomNumber()
    local ranNum = math.random(1, 4)
    if ranNum == 1 then
    print("Ice world")
    elseif ranNum == 2 then
    print("Desert")
    elseif ranNum == 3 then
    print("Pirate island")
    elseif ranNum == 4 then
    print("The vulcano")
    end
    end
    randomNumber()

    • @grainter5
      @grainter5 28 วันที่ผ่านมา

      here's a tip: if you're only going to use a function once, you shouldn't use a function at all and instead just write the code inside the function itself.

    • @zuhniwnl
      @zuhniwnl 17 วันที่ผ่านมา

      @@grainter5 huh

    • @grainter5
      @grainter5 16 วันที่ผ่านมา

      @@zuhniwnl if youre gonna make a function but then only use it once, the function was pointless because you could've just written whatever code was in the function and it would've ran the same but with less lines

  • @MeowToonYT
    @MeowToonYT 27 วันที่ผ่านมา +1

    An advice from me is to write down all the events you learned in a book or document

  • @vmc-mal
    @vmc-mal 5 หลายเดือนก่อน +2

    Almost done with the playlist, have learnt quite a lot!
    local rng = math.random(1,64)
    local roof1 = game.Workspace.House.Roof1
    local roof2 = game.Workspace.House.Roof2
    --[[ Disabling this since I am using this script actively.
    print(rng)]]
    --This randomizes the color of the roof.
    while true do
    local rv = math.random(0,255)
    local gv = math.random(0,255)
    local bv = math.random(0,255)
    roof1.BrickColor = BrickColor.new(Color3.fromRGB(rv, gv, bv))
    roof2.BrickColor = BrickColor.new(Color3.fromRGB(rv, gv, bv))
    task.wait(.5)
    end

  • @PlayFroge_gamer
    @PlayFroge_gamer 23 วันที่ผ่านมา +1

    why does this video have exactly 9 minutes and 11 seconds?
    btw here is what i did
    local plate = game.Workspace.Baseplate
    while true do
    plate.Color = Color3.new(math.random(0, 260), math.random(0, 260), math.random(0, 260))
    wait(3)

    end
    -- it is also a way to do it without any variable but if you want to use it for different objects etc it is better to use variables

  • @RobloxClipShorts
    @RobloxClipShorts 2 หลายเดือนก่อน

    I can't believe I'm already here, thank you so much!

  • @fascinatingfaux811
    @fascinatingfaux811 5 หลายเดือนก่อน +2

    I was able to make some spheres that roll around a box and change colors every few seconds but I can’t paste the code since I’m not on the PC right now.

  • @JoeKSP
    @JoeKSP วันที่ผ่านมา +1

    local display = game.Workspace.sign.SurfaceGui.TextLabel
    timeLeft = math.random(20, 100)
    display.Text = timeLeft
    for countdown = 1, timeLeft, 1 do
    timeLeft = timeLeft - 1
    display.Text = timeLeft
    task.wait(1)
    end
    this does so a countdown starts on a textlabel, the number to countdown from is random but whatever it is it always stops at 0

  • @rizzzzzlestudios5555
    @rizzzzzlestudios5555 2 หลายเดือนก่อน

    good video 👍👍

  • @space.13311
    @space.13311 18 วันที่ผ่านมา

    its crazy how it went from 50k + to 26k wow
    i love your tutorials it helped me

  • @amvyori5617
    @amvyori5617 หลายเดือนก่อน

    new to scripting and have been trying to learn steadily so i made this:
    local randomNumber = math.random(1, 6)
    print(randomNumber)
    if randomNumber >= 1 and randomNumber = 4 and randomNumber

  • @Fudge_Minister
    @Fudge_Minister วันที่ผ่านมา +1

    I made an epilepsy block 😀

  • @VoidBloomYT
    @VoidBloomYT 4 หลายเดือนก่อน +18

    heres a code that i made to signify my gambling addiction.
    while true do

    local random = math.random(1, 6)

    print(random)

    if random == 6 then

    print("jackpot!")

    end

    task.wait(2)
    end

    • @Architect-u2g
      @Architect-u2g 3 หลายเดือนก่อน +1

      That kinda looks like python code ngl

    • @Superiorrod
      @Superiorrod 3 หลายเดือนก่อน +1

      hakari

    • @aidandoesanimations
      @aidandoesanimations 2 หลายเดือนก่อน +1

      MAKE A SLOT MACHINE

  • @elijah444
    @elijah444 2 หลายเดือนก่อน

    I made a button that has a 1/10 chance to turn a screen yellow! Amazing tutorials btw

  • @imthesilly-k9j
    @imthesilly-k9j 2 หลายเดือนก่อน +1

    Yo, I have one question about this whole thing. I’m trying to make a game with my friend and you didn’t really explain one of the parts that I need to know so maybe can you explain it if you reply to this I’ll tell you what I need to explain.

  • @MdkerMdxer
    @MdkerMdxer 4 หลายเดือนก่อน

    6:35 u can also change the baseplate color using the following script
    local Baseplate = game.Workspace.Baseplate
    Baseplate.BrickColor = BrickColor.Random()

    • @SimplyTutuco
      @SimplyTutuco 2 หลายเดือนก่อน

      BrickColor.Random() limits the amount of colors, now the way he did is absolutelly any color out of the over 765 the game has.

  • @Exrl_
    @Exrl_ 2 หลายเดือนก่อน

    nice video lenght

  • @YorSato
    @YorSato 2 หลายเดือนก่อน +1

    3 more videos and i should be done with this and i can move to the advance one P.S this is my second day tomorow im gone watch the last 3 and i should be good to go GOOD NIGHT P.S your teaching skills are very good you should be a teach no cap

  • @banditbaws
    @banditbaws หลายเดือนก่อน

    I created a "gamba sphere" that spins for either a "common" or a "rare" using the math.random function when touched by a humanoid with a 1.5s cooldown
    local sphere = script.Parent
    local cooldown = false
    sphere.Touched:Connect(function(partTouched)
    local humanoid = partTouched.Parent:FindFirstChild('Humanoid')
    if humanoid then
    if cooldown == false then
    cooldown = true
    local randomValue = math.random(1,6)
    if randomValue = 5 then
    print('Rare')
    end
    task.wait(1.5)
    cooldown = false
    end
    end
    end)

  • @Romyplaysgames
    @Romyplaysgames หลายเดือนก่อน

    local room = math.random(1, 3)
    if room == 1 then
    print("scary room")
    elseif room == 2 then
    print("nice room")
    elseif room == 3 then
    print("horrifying room")
    end

  • @babyjacob_7855
    @babyjacob_7855 5 หลายเดือนก่อน

    i also love this local dice = math.random(1, 6)
    local d = math.random(1, 6)
    print("And The Dice Roll Is... ".. dice + d)

  • @shodisk
    @shodisk 3 หลายเดือนก่อน +3

    local money = 1782300
    local eggCost = 20000
    while money >= eggCost do
    local chance = math.random(1, 100)

    if chance

    • @akuji9166
      @akuji9166 3 หลายเดือนก่อน +1

      I wanna ask something the "if chance

    • @akuji9166
      @akuji9166 3 หลายเดือนก่อน

      elseif chance

  • @TheCoolCat521
    @TheCoolCat521 หลายเดือนก่อน +1

    An almost impossible (1/16581375) random guesser where there are 3 generator that fires once and 3 generator on a while loop. The (unrealistic) goal is to match the generated value of all 3 RGB color.
    local random1 = math.random(0, 255)
    local random2 = math.random(0, 255)
    local random3 = math.random(0, 255) -- generating the colors of the "answer"
    local part = game.Workspace.Part
    local Answer = print(random1, random2, random3) -- defining the "answer"
    while true do -- while loop
    task.wait(0.2)
    local randomR = math.random(0, 255)
    local randomG = math.random(0, 255)
    local randomB = math.random(0, 255) -- guessing the color value for the 3 color which will be checked

    if random1 == randomR and random2 == randomG and random3 == randomB then -- checks the answer
    print('Nice you got the correct color,', Answer)
    part.Color = Color3.fromRGB(randomR, randomG, randomB)
    else part.Color = Color3.fromRGB(randomR, randomG, randomB) -- continues if answer is wrong
    end
    end

  • @sora5484
    @sora5484 20 วันที่ผ่านมา

    if the baseplate gets touched, it turns a random value of transparency:
    local baseplate = game.Workspace.Baseplate
    local humanoid = baseplate.Touched:Connect(function(otherPart)
    local touched = false
    if touched == false then
    touched = true
    local transparency = math.random()
    baseplate.Transparency = transparency
    print("It is invisibile now")
    task.wait(2)
    end

    end)

  • @xastrovibzx587
    @xastrovibzx587 หลายเดือนก่อน +1

    --Imma fr make a rng thing really quick or try to anyways
    local Common = "Common"
    local Rare = "Rare"
    local Epic = "Epic"
    local Legendary = "Legendary"
    local Mythic = "Mythic"
    while true do
    local numbers = math.random(1, 6)
    if numbers == 1 then
    print("Rolled ", Common)
    elseif numbers == 2 then
    print("Rolled ", Rare)
    elseif numbers == 3 then
    print("Rolled ", Epic)
    elseif numbers == 4 then
    print("Rolled ", Legendary)
    elseif numbers == 5 then
    print("Rolled ", Mythic)
    elseif numbers == 6 then
    print("Spinning has ended for hitting 6.")
    break
    end
    task.wait(1)
    end
    --Kinda forgot to make Uncommon but that's alright lol. This should roll until you get 6 which will then stop spinning and print your rarity each time.

    • @Mango_-
      @Mango_- หลายเดือนก่อน

      looks like a python script ngl

  • @MACKENZIE_DAVID2
    @MACKENZIE_DAVID2 หลายเดือนก่อน

    Thank you so much! I made a RNG button!

  • @Magnificent_Potato
    @Magnificent_Potato 6 วันที่ผ่านมา

    I was honestly surprised that my code worked, but anyway here it is!
    local baseplate = game.Workspace.Baseplate
    while true do
    local redValue = math.random(0, 255)
    local blueValue = math.random(0, 255)
    local greenValue = math.random(0, 255)

    baseplate.Color = Color3.fromRGB(redValue, blueValue, greenValue)

    task.wait(1)

    if baseplate.Color == Color3.fromRGB(redValue, blueValue, greenValue) then
    print("The color has changed to a random color!")
    end
    end
    Thank you so much for teaching me to code BrawlDev!

  • @thetruebigfloppa
    @thetruebigfloppa 14 วันที่ผ่านมา

    this is pretty basic but i should definitely try anyways:
    local baseplate = workspace.Baseplate
    --[[while true do
    local redValue = math.random(0, 255)
    local greenValue = math.random(0, 255)
    local blueValue = math.random(0, 255)

    baseplate.Color = Color3.fromRGB(redValue, greenValue, blueValue)
    task.wait()
    end]]
    -- print("THIS IS COMPLETE CHAOS")
    --[[while true do
    baseplate.Transparency = math.random()
    task.wait()
    end]]
    while true do -- creates an infinite while loop
    local randomDecimal = math.random() --[[ creates a variable called randomDecimal and sets it to any number
    from 0 to 1]]
    local randomNumber = math.random(0, 1) -- creates a variable called randomNumber and sets it to either 0 or 1
    if randomNumber == randomDecimal then -- checks if randomNumber and randomDecimal are the same number
    print("THE STARS HAVE ALIGNED")
    end
    task.wait()
    end

  • @thedinobros1218
    @thedinobros1218 17 วันที่ผ่านมา

    Will this work to make a horror game where the number is the monster that appears?

  • @liutenant-blob_pond
    @liutenant-blob_pond 2 หลายเดือนก่อน

    So i decided to model a discord setup, a simple 3x3. i would use what we learnt from last video(Script.Parent) to relate to the part, adding it into the parts. eventually the script worked with 1, so i copied it into the others not needing to chnage(cuase the parent is changing), and....
    IT WORKED.
    if you want to try this out for yyourself, or jus t wanna see the script, i used the same one from the video, here is the script:
    local color = script.Parent
    while true do
    local redValue = math.random(0,225)
    local blueValue = math.random(0,225)
    local greenValue = math.random(0,225)

    color.Color = Color3.fromRGB(redValue, blueValue, greenValue)
    task.wait(1)
    end

  • @DevRRG
    @DevRRG 2 หลายเดือนก่อน +1

    Although i am not a beginner dev i watched this Video to learn more about math.random. i made a local script inside of starterplayerscripts, everytime a player pressed the letter F, the baseplate color changes randomly here is the script: local Uis = game:GetService("UserInputService")
    local baseplate = game.Workspace:WaitForChild("Baseplate")
    if baseplate then
    print("baseplate is in Workspace")
    else
    warn("baseplate is not in Workspace")
    end
    Uis.InputBegan:Connect(function(Input)
    if Input.KeyCode == Enum.KeyCode.F then
    print("F has been Pressed")

    local redValue = math.random(0, 255)
    local greenValue = math.random(0, 255)
    local blueValue = math.random(0, 255)

    baseplate.Color = Color3.fromRGB(redValue, greenValue, blueValue)

    end
    end)

    • @6xysh
      @6xysh 2 หลายเดือนก่อน

      woahh

    • @TANER845
      @TANER845 2 หลายเดือนก่อน

      show off

    • @DevRRG
      @DevRRG 2 หลายเดือนก่อน

      @@TANER845 huh?

    • @purple-ispurple
      @purple-ispurple 2 หลายเดือนก่อน

      That actually made sense

    • @truongvinh3386
      @truongvinh3386 2 หลายเดือนก่อน +1

      ​@TANER845 it's not showing off this person is a intermediate-pro dev, by them kindly sending these codes newer devs like me can learn too. Maybe ur just jealous cause u suck but it's not showing off

  • @MaximLankin
    @MaximLankin 4 หลายเดือนก่อน

    first time learning in depth i feel lowkey happy with this code i created a brick that randomizes color every time its touched with debounce that i had to search up how to do because i was frustrated that the colors kept changing as long as i touched the brick
    local brick = script.Parent
    local debounce = false
    brick.Touched:Connect(function(otherpart)
    local humanoid = otherpart.Parent:FindFirstChild("Humanoid")
    if humanoid and not debounce then
    debounce = true

    local redValue = math.random(0, 255)
    local greenValue = math.random(0, 255)
    local blueValue = math.random(0, 255)

    brick.Color = Color3.fromRGB(redValue, greenValue, blueValue)
    task.wait(1)
    debounce = false
    end
    end)

  • @JohnSminks
    @JohnSminks 5 หลายเดือนก่อน +1

    local baseplate = game.Workspace.Baseplate
    while true do
    local randomValue = math.random()
    baseplate.Transparency = randomValue

    if baseplate.Transparency > 0.9 then
    print("Wow, your baseplate is pretty dang transparent.")
    end
    task.wait(1)
    end

    • @Ismalellel
      @Ismalellel 5 หลายเดือนก่อน +1

      haha cool

  • @KJsjdjsjsj
    @KJsjdjsjsj 2 หลายเดือนก่อน

    Btw for the random baseplate color you dont have to do that just do this
    local baseplate = game.workspace.Baseplate
    local color = 1
    baseplate.Touched:connect(function(change)
    while color < 5 do
    baseplate.BrickColor = Brickcolor.random()
    task.wait(1)
    end
    end)

  • @slaveigaming
    @slaveigaming วันที่ผ่านมา

    i made that someblock simulate what i have got a common or a rare or a godly js like mm2 ur the best

  • @TwinkleSav
    @TwinkleSav 17 ชั่วโมงที่ผ่านมา

    here's what I made!
    local baseplate = game.Workspace.Baseplate
    while true do
    local randomValue = math.random(0.00, 1.00)

    baseplate.Transparency = randomValue
    task.wait(0.01)
    end

  • @jakgutn
    @jakgutn 5 หลายเดือนก่อน +1

    (as always) great tutorial🎉, but how can I do this if I want a decimal number with a certain number of decimal places? (for example two)

    • @mathbrah
      @mathbrah 5 หลายเดือนก่อน +1

      uhm

  • @iCreateGamez
    @iCreateGamez 3 หลายเดือนก่อน

    I wanted to do something a bit more complex but it didn't work, and didn't stop using a particular number. And one time, it even crashed my game. This is the one I ended up with:
    local petOpening = math.random(1,5)
    if petOpening == 1 then
    print("You got a(n) [COMMON] Elephant (1/5)")
    end
    if petOpening == 2 then
    print("You got a(n) [COMMON] Dog (2/5)")
    end
    if petOpening == 3 then
    print("You got a(n) [UNCOMMON] ZEBRA (3/5)")
    end
    if petOpening == 4 then
    print("You got a(n) [LEGENDARY] DRAGON(4/5)")
    end
    if petOpening == 5 then
    print("You got a(n) [MYTHICAL] AZUNE(5/5)")
    end

  • @TropialGamingYT
    @TropialGamingYT 4 หลายเดือนก่อน

    The Root to Gambling Love it. Great video learned how to make a chance system and gamble...

  • @JailbreakerSlower
    @JailbreakerSlower 4 วันที่ผ่านมา

    randomNumber = math.random(1, 10)
    print(randomNumber)
    if randomNumber

  • @Johnnyjones23
    @Johnnyjones23 29 วันที่ผ่านมา

    Hey, Brawldev I think going a little bit too fast especially in a Roblox studio script beginners guide

  • @goodnoob857
    @goodnoob857 4 หลายเดือนก่อน

    best ever scriping tutorial I have seen

  • @ItglBna
    @ItglBna 4 หลายเดือนก่อน

    9:11 he he he

  • @Stickmangold360
    @Stickmangold360 3 หลายเดือนก่อน

    i made gambling script in the gui
    local text = script.Parent
    text.Visible = false
    while true do
    local roll = math.random(1,6)
    print(roll)
    if roll == 6 then
    text.Visible = true
    end

    task.wait(2)

    text.Visible = false
    end

  • @kiten9
    @kiten9 หลายเดือนก่อน

    cant you just use random variable instead of 3 since they do they exact same thing 7:50

  • @frbestguy
    @frbestguy 4 หลายเดือนก่อน +1

    local baseplate = workspace:FindFirstChild("Baseplate")
    local function randomNum()
    local randomnumber = math.random(1, 4)
    if randomnumber == 1 then
    baseplate.Color = Color3.fromRGB(255, 90, 100)
    elseif randomnumber == 2 then
    baseplate.Color = Color3.fromRGB(100, 255, 100)
    elseif randomnumber == 3 then
    baseplate.Color = Color3.fromRGB(100, 100, 255)
    elseif randomnumber == 4 then
    baseplate.Color = Color3.fromRGB(255, 255, 100)

    end

    end
    local counter = 1
    while counter

  • @ChipiChipiKAYRA
    @ChipiChipiKAYRA 3 หลายเดือนก่อน

    I did a script that picks a number between 1 and 8 and a text shows that number
    local RandomNumber = math.random(1, 8)
    local Text = game.Workspace.RandomNumberPart.SurfaceGui.TextLabel
    Text.Text = (RandomNumber)

  • @bigmacyummy8974
    @bigmacyummy8974 หลายเดือนก่อน

    so basically i made a part that combines the events, find first child & wait for child and this tutorials for my script. The part changes the transparency and colors randomly when its touch with a 2 second cooldown!
    script:
    local colorPart = script.Parent
    local debounce = false
    colorPart.Touched:Connect(function(otherPart)
    if not debounce then
    local humanoid = otherPart.Parent:FindFirstChild("Humanoid")
    if humanoid then
    debounce = true
    local redValue = math.random(0, 255)
    local greenValue = math.random(0, 255)
    local blueValue = math.random(0, 255)
    colorPart.Color = Color3.fromRGB(redValue, greenValue, blueValue)
    local randomTransparency = math.random()
    colorPart.Transparency = randomTransparency
    task.wait(2)
    debounce = false
    end
    end
    end)

  • @chalmcal
    @chalmcal 5 หลายเดือนก่อน +1

    (warning, big code)
    chamber = math.random(1, 6)
    if chamber == 1 then
    print("you are dead")
    else print("you lived")
    print(chamber)
    task.wait(2)
    chamber = math.random(1,5)
    if chamber == 1 then
    print("you are dead")
    else print("you lived")
    print(chamber)
    task.wait(2)
    chamber = math.random(1,4)
    if chamber == 1 then
    print("you are dead")
    else print("you lived")
    print(chamber)
    task.wait(2)
    chamber = math.random(1,3)
    if chamber == 1 then
    print("you are dead")
    else print("you lived")
    print(chamber)
    task.wait(2)
    chamber = math.random(1,2)
    if chamber == math.random(1,2) then
    print("you are dead")
    else print("you have lived")
    print(chamber)

    end
    end
    end
    end
    end

    • @chalmcal
      @chalmcal 5 หลายเดือนก่อน

      I wasn't happy with that version so I improved it
      local gun = math.random(1, 6)
      local TheGame = script.Parent
      local fire = TheGame:FindFirstChild("fire")
      local spin = TheGame:FindFirstChild("spin")
      fire.Touched:Connect(function(otherpart)
      local humanoid = otherpart.Parent:FindFirstChild("Humanoid")
      if humanoid then
      if gun == 1 then
      humanoid.Health = 0
      print("you died")
      else print("you lived")
      gun = gun - 1
      task.wait(5)
      end
      else task.wait(5)
      end
      end)
      spin.Touched:Connect(function(otherpart)
      local humanoid = otherpart.Parent:FindFirstChild("Humanoid")
      if humanoid then
      gun = math.random(1, 6)
      print("coward")
      task.wait(5)
      end
      end)

    • @TheOnlyChunti
      @TheOnlyChunti 5 หลายเดือนก่อน

      and how is it useful?

  • @somethingmysterious1135
    @somethingmysterious1135 20 วันที่ผ่านมา

    Randomly changes the value of transparency(0.2-0.5):
    local brickFinder = script.Parent
    while true do
    brickFinder.Transparency = math.random(2, 5) / 10 -- Had a hard time getting floating point values but looked online to find out that u can divide by 10 to get floating points
    task.wait(1)

    end

  • @RaptorClaus0_0690
    @RaptorClaus0_0690 3 หลายเดือนก่อน +1

    "a six-sided die and when we roll this die its going to land on a number between 1 and 6"
    OH REALLY

  • @ettoremoralles5633
    @ettoremoralles5633 หลายเดือนก่อน

    I upgraded a bit the script of changing the basePlate color, i made it deect if a especific block is being touched by a player so it can run the script to change the baseplate color
    local changeb = game.Workspace:WaitForChild("Mudar") -- ensures that the part exist
    local debounce = false
    changeb.Touched:Connect(function(otherPart)
    if not debounce then
    debounce = true
    print("Touched by:", otherPart.Name)
    changeb.Color = Color3.new(0, 0, 0)
    local humanoid = otherPart.Parent:FindFirstChild("Humanoid") -- ensures that the body part exist
    if humanoid then
    local plate = game.Workspace:WaitForChild("dw") -- ensures that the baseplate exist
    local count = 1
    while count

  • @EEAASSEE
    @EEAASSEE หลายเดือนก่อน

    i did the baseplate thing but when it changes, the decal changes transparency (lazy)
    local baseplate = game.Workspace.Baseplate
    while true do
    local redvalue = math.random(0, 255)
    local greenvalue = math.random(0, 255)
    local bluevalue = math.random(0, 255)
    baseplate.BrickColor = BrickColor.new("white")
    baseplate.Texture.Transparency = 1
    task.wait(0.1)
    baseplate.Texture.Transparency = 0.50
    baseplate.Color = Color3.fromRGB(redvalue, greenvalue, bluevalue)
    task.wait(0.09)
    end

  • @Ggwinziscool
    @Ggwinziscool 4 หลายเดือนก่อน

    i made a RNG using prints, is there any way i can make this shorter?
    local RNG = math.random(1, 16)
    print(RNG)
    if RNG == 1 then
    print("you got a common")
    end
    if RNG == 2 then
    print("you got an uncommon")
    end
    if RNG == 3 then
    print("you got a rare")
    end
    if RNG == 4 then
    print("you got an epic")
    end
    if RNG == 5 then
    print("you got a legendary!")
    end
    if RNG == 6 then
    print("you got a mythic!")
    end
    if RNG == 7 then
    print("you got a destroyer!")
    end
    if RNG == 8 then
    print("you got a crazy!!!")
    end
    if RNG == 9 then
    print("YOU GOT ERROR!")
    end
    if RNG == 10 then
    print("you got a black hole!!?!?!")
    end
    if RNG == 11 then
    print("you got a nebula!")
    end
    if RNG == 12 then
    print("you got a DEATH!")
    end
    if RNG == 13 then
    print("you got a heaven!")
    end
    if RNG == 14 then
    print("you got a SUN!")
    end
    if RNG == 15 then
    print("you got a BREAKAGE!")
    end
    if RNG == 16 then
    print("you got a mentally unstable lol")
    end

    • @ansjsj3ensudka
      @ansjsj3ensudka 4 หลายเดือนก่อน +1

      local messages = {
      [1] = "you got a common",
      [2] = "you got an uncommon",
      [3] = "you got a rare",
      [4] = "you got an epic",
      [5] = "you got a legendary!",
      [6] = "you got a mythic!",
      [7] = "you got a destroyer!",
      [8] = "you got a crazy!!!",
      [9] = "YOU GOT ERROR!",
      [10] = "you got a black hole!!?!?!",
      [11] = "you got a nebula!",
      [12] = "you got a DEATH!",
      [13] = "you got a heaven!",
      [14] = "you got a SUN!",
      [15] = "you got a BREAKAGE!",
      [16] = "you got a mentally unstable lol"
      }
      local RNG = math.random(1, 16)
      print(RNG)
      print(messages[RNG])

  • @sidecoolguy2858
    @sidecoolguy2858 26 วันที่ผ่านมา +1

    local part = script.Parent
    local function pick()
    local pet = math.random(1,5)
    if pet == 1 then
    print ('you got dog')
    elseif pet == 2 then
    print ('you got cat')
    elseif pet == 3 then
    print ('you got mouse')
    elseif pet ==4 then
    print ('you got fox')
    elseif pet == 5 then
    print ('you got hamster')
    end
    end
    pick()

  • @Ovaix1x
    @Ovaix1x หลายเดือนก่อน

    do i make a schizophrenia themed game bc i can make the material and color change as fast as i want

  • @Sehaj_8ck
    @Sehaj_8ck 4 หลายเดือนก่อน +1

    Why this video is 9:11 long😅

  • @ax4842
    @ax4842 3 หลายเดือนก่อน

    i did a luckyblock
    local touchPart = game.Workspace["LuckyBlock"]
    local partIsTouched = false
    touchPart.Touched:Connect(function(otherPart)
    local humanoid = otherPart.Parent:FindFirstChild("Humanoid")
    if partIsTouched == false then
    partIsTouched = true
    local result = math.random(1, 20)
    if result

  • @SLick31
    @SLick31 8 วันที่ผ่านมา

    local shinypokemon = math.random(1, 5)
    if shinypokemon == 5 then
    print("Shiny Pokemon has appeared!")
    else
    print(shinypokemon)
    end

  • @that-original-channel
    @that-original-channel 3 หลายเดือนก่อน

    local rand = math.random(1, 32)
    local jackpot = 32
    while true do
    if rand == jackpot then
    print("YOU HIT THE JACKPOT!")
    end
    task.wait(0.5)
    rand = math.random(1, 32)
    end

  • @grainter5
    @grainter5 28 วันที่ผ่านมา

    while task.wait(2.5) do
    local i = math.random(1,1000)
    if i >= 990 then
    print("Legendary")
    elseif i >= 900 then
    print("Epic")
    elseif i >= 750 then
    print("Rare")
    elseif i >= 500 then
    print("Uncommon")
    elseif i >= 2 then
    print("Common")
    else
    print("Mythical")
    end
    end
    -- very simple code that i wrote, runs every 2.5 seconds and will print one of those messages. some are much rarer than others and "Mythical" is 1/1000.

  • @stenkkujontunen29
    @stenkkujontunen29 3 หลายเดือนก่อน

    You have helped me soo much with coding i really appriciate it and this is what i made.
    --[[
    local KillBrick = script.Parent
    KillBrick.Anchored = true
    KillBrick.Material = ("Neon")
    KillBrick.Color = Color3.fromRGB(255, 255, 255)
    local Thingy = true
    KillBrick.Touched:Connect(function(Otherpart)
    local Humanoid = Otherpart.Parent:FindFirstChild("Humanoid")
    Thingy = false
    local Sigma = math.random(0, 100)
    print(Sigma)
    if Humanoid then
    Humanoid.Health = (Sigma)
    while Thingy == false do
    local Greenvalue = math.random(0, 255)
    local BlueValue = math.random(0, 255)
    local RedValue = math.random(0, 255)
    if Humanoid then
    KillBrick.Color = Color3.fromRGB(Greenvalue,BlueValue,RedValue)
    task.wait(2)
    Thingy = true
    if Thingy == true then
    KillBrick.Color = Color3.fromRGB(255, 255, 255)
    end
    end
    end
    end
    end)
    ]]

  • @Mah_guy
    @Mah_guy 5 หลายเดือนก่อน

    this is a little rng game that i made!
    print("try to get 5 in the least tries possible!")
    local result = 0
    variable2 = 0
    function function1()
    variable2 = variable2 + 1
    result = math.random(1,5)
    print(result)
    if result == 5 then variable3 = 1
    else variable3 = 0
    end
    if variable3 == 1 then print("lucky duck!") print(variable2, "tries!")
    else print("try again!") function1()
    end

    end
    if result == 0 then function1()
    end

  • @RuthlesLatrell
    @RuthlesLatrell หลายเดือนก่อน

    I made it loop
    local value = math.random(1,10)
    for theluckyloop = 1, 3, 1 do
    print("If this 10 sided dice lands on") task.wait(2) print(value) task.wait(2) print("you win a million dollars")
    task.wait(2)
    print("Rolling 10 sided dice...")
    local luckydraw = math.random(1,10)
    task.wait(2)
    if luckydraw == value
    then print("You win a million dollars you rolled a") task.wait(1) print(luckydraw)
    else print("Try again next time", "you rolled a") task.wait(1) print(luckydraw)
    task.wait(2)
    end
    end

  • @unianid7875
    @unianid7875 27 วันที่ผ่านมา

    local randomNumber = math.random(1,2)
    if randomNumber == 1 then
    print("wow")
    elseif randomNumber == 2 then
    print("oh")
    end

  • @DNLGio_de_Pio
    @DNLGio_de_Pio 23 วันที่ผ่านมา

    local baseplate = workspace.Baseplate
    local randomNumber = math.random(1, 3)
    if randomNumber == 1 then
    baseplate.Transparency = 1
    baseplate.Anchored = false
    print("NOOOO!!! Don't die!")
    end
    print(randomNumber)

  • @Eternal_Night17
    @Eternal_Night17 2 หลายเดือนก่อน

    Lol, I made that whenever I touch the TouchPart, then teleportPart is going to teleport to the random location based on random numbers, I'm so proud.
    local touchPart = script.Parent
    local teleportedPart = touchPart:FindFirstChild("TeleportPart")
    local canTouchPart = true
    local function randomPosGen()
    local xPos = math.random(1, 30)
    local yPos = math.random(1, 5)
    local zPos = math.random(1, 30)

    return Vector3.new(xPos, yPos, zPos)
    end
    local function tpPartOnTouch(otherpart)
    if teleportedPart and canTouchPart == true then
    local randomPos = randomPosGen()
    teleportedPart.Position = randomPosGen()
    canTouchPart = false
    task.wait(2)
    canTouchPart = true
    end
    end
    touchPart.Touched:Connect(tpPartOnTouch)

  • @NoM0v1NgcH4NneLs9w_
    @NoM0v1NgcH4NneLs9w_ 4 หลายเดือนก่อน

    -- LEARNING OBJECTIVE:
    local function roll()
    local randomNumber = math.random(0, 1000)

    if randomNumber >= 0 and randomNumber < 700 then
    print("COMMON!")
    elseif randomNumber >= 700 and randomNumber < 900 then
    print("RARE!!")
    elseif randomNumber >= 900 and randomNumber

  • @Thekingofbees12
    @Thekingofbees12 2 หลายเดือนก่อน

    Who else got 2 first try when testing random?

  • @yonosaboluis
    @yonosaboluis 5 หลายเดือนก่อน

    took a little minute to figure out but this has the block randomly move
    local brick = game.Workspace.brick
    while true do
    local xValue = math.random(-1, 1)
    local yValue = math.random(-1, 1)
    local zValue = math.random(-1, 1)

    brick.Position = Vector3.new(xValue, yValue, zValue)

    task.wait(1)
    end

  • @zenknight4839
    @zenknight4839 4 หลายเดือนก่อน

    while true do
    local ranWord = math.random(0, 3)

    if ranWord == 0 then
    print("Stepanci")
    elseif ranWord == 1 then
    print("Caporetto")
    elseif ranWord == 2 then
    print("Somme")
    else
    print("Aisne")
    end

    task.wait(3)
    end
    Basically a map randomizer

  • @doge4101
    @doge4101 หลายเดือนก่อน

    I have a tip for you guys, when doing math.random just use interval notation

  • @kruczak7896
    @kruczak7896 5 หลายเดือนก่อน

    This dice can only be rolled once
    local cube = script.Parent
    local randomRoll = math.random(1, 6)
    cube.Touched:Once(function(SnakeEyes)
    local RFoot = SnakeEyes.Parent:FindFirstChild("RightFoot")
    if RFoot then
    print(randomRoll)
    end
    end)

  • @therealjohnn5928
    @therealjohnn5928 2 หลายเดือนก่อน

    Cant you also do this?
    local baseplate = game.Workspace.Baseplate
    while true do
    baseplate.BrickColor = BrickColor.Random()
    wait(10)
    end

  • @aapple7993
    @aapple7993 5 หลายเดือนก่อน

    --once brick touched, takes random amount of health, when touched again takes away from 0 - current health, part is rainbow
    local killBrick = script.Parent
    killBrick.Touched:Connect(function(otherPart)
    local humanoid = otherPart.Parent:FindFirstChild('Humanoid')
    if humanoid then
    humanoid.Health = math.random(0, humanoid.Health)
    print('You now have', humanoid.Health)
    task.wait(1)
    end
    end)
    while true do
    local redValue = math.random(0, 255)
    local greenValue = math.random(0, 255)
    local blueValue = math.random(0, 255)
    killBrick.Color = Color3.fromRGB(redValue, greenValue, blueValue)
    task.wait(1)
    end

  • @Soyzs
    @Soyzs หลายเดือนก่อน

    Decided to do a really basic script where i just added onto the script made in video, it changes the baseplate color along with its transparency to from a value of (0, 1): local baseplate = game.Workspace.Baseplate
    while true do
    local redValue = math.random(0, 255)
    local greenValue = math.random(0, 255)
    local blueValue = math.random(0, 255)

    baseplate.Color = Color3.fromRGB(redValue, greenValue, blueValue)
    baseplate.Transparency = math.random(0.1, 1)

    task.wait(2)
    end

  • @reverdinm
    @reverdinm หลายเดือนก่อน

    local baseplate = game.Workspace.Baseplate
    while true do
    local red = math.random(100, 255)
    local green = math.random(100, 255)
    local blue = math.random(100, 255)

    if red+green+blue >=580 then
    local result = math.random(1,3)
    if result == 1 then
    red = red - 120
    end
    if result == 2 then
    green = green - 120
    end
    if result == 3 then
    blue = blue - 120
    end
    end
    baseplate.Color = Color3.fromRGB(red, green, blue)
    wait(0.1)
    end
    I basically made a script that, when it is run, changes the baseplate's color 10 times every second. You know, like a disco. But I didn't want the weird blacks, browns, or other dark colors showing up (Like you'd normally see with math.random(0,255)) so I decided to make the minimum range higher - but then I found too much white or pastel colors showing up, so I also made it so that if the sum of all of their RGB values were too high, then I'd randomly pick one to subtract from, making yellow, purple and cyan more common. This results in a pretty decent disco floor.

  • @MM-rl5xl
    @MM-rl5xl หลายเดือนก่อน

    this is what i did to changes colors and speed to make it random
    local speedBrick = game.Workspace.TouchedPart
    while true do
    wait(math.random(.5, 1))

    red = math.random(0, 255)
    blue = math.random(0, 255)
    green = math.random(0, 255)

    speedBrick.Color = Color3.fromRGB(red, blue, green)

    if speedBrick then
    speedBrick.Touched:Connect(function(otherPart)
    local humanoid = otherPart.Parent:FindFirstChild("Humanoid")

    if humanoid then
    humanoid.WalkSpeed = math.random(1, 100)--You can change the speed from here (1, 100)
    end
    end)
    end
    end

  • @NicholasKiruthi
    @NicholasKiruthi 27 วันที่ผ่านมา

    local function ranum()
    ranum = math.random(0,78)
    for ranum = 1, 100 do
    if ranum == 72 then
    print("I think we are done here!")
    break
    else
    continue
    end
    end
    end
    ranum()

  • @imgonnatalk
    @imgonnatalk 6 วันที่ผ่านมา

    local baseplate = game.Workspace.Baseplate
    local touchpart = game.Workspace.touchpart
    local partIsTouched = false
    touchpart.Touched:Connect(function(otherPart)
    if partIsTouched == false then
    local red = math.random(0, 255)
    local green = math.random(0, 255)
    local blue = math.random(0, 255)
    partIsTouched = true
    print("part touched")
    baseplate.Color = Color3.fromRGB(red, green, blue)
    partIsTouched = false
    end
    end)
    every time you touch the touchpart that we made earlier the baseplate changes colors

  • @Kirmizi_Domates
    @Kirmizi_Domates 4 หลายเดือนก่อน

    i did something like this for learning objective
    local part = script.Parent
    local colorChange = false
    local coolDown = false
    part.Touched:Connect(function(touched)

    local isHumanoidTouched = touched.Parent:FindFirstChild("Humanoid")

    if isHumanoidTouched and coolDown == false then

    colorChange = true

    if colorChange == true then
    local redRGB = math.random(0,255)
    local greenRGB = math.random(0,255)
    local blueRGB = math.random(0,255)
    part.Color = Color3.fromRGB(redRGB,greenRGB,blueRGB)
    colorChange = false
    coolDown = true
    task.wait(3)
    coolDown = false

    end



    end


    end)

  • @rodneysot
    @rodneysot 4 หลายเดือนก่อน

    local corner = script.Parent
    local Random = math.random(1, 12)
    corner.Touched:Connect(function(theOtherPart)
    local humanoid = theOtherPart.Parent:FindFirstChild("Humanoid")
    if humanoid then
    print (Random)
    end
    end)

  • @Jouniii
    @Jouniii 26 วันที่ผ่านมา

    Random colors on part when touched:
    local part = script.Parent
    part.Touched:Connect(function(touched)
    local humanoid = touched.Parent:FindFirstChild("Humanoid")
    if humanoid then
    local red = math.random(0, 255)
    local green = math.random(0, 255)
    local blue = math.random(0, 255)
    part.Color = Color3.fromRGB(red, green, blue)
    end
    end)

  • @DBRMajinChame
    @DBRMajinChame 3 หลายเดือนก่อน +1

    GAMBLING RAHHH
    while true do
    wait("2")
    local Gambling = math.random(1, 150)
    print(Gambling)
    end

  • @creepercraft2853
    @creepercraft2853 26 วันที่ผ่านมา

    local wall = game.Workspace["The Wall"]
    while true do
    local transparency = math.random()

    wall.Transparency = transparency

    task.wait(0.5)
    end

  • @kirillo4137
    @kirillo4137 3 หลายเดือนก่อน

    I made a slots machine, if you get any 3 numbers together you will get a small prize, and if all 3 numbers are 7's then you will get a jack pot. a single 10 will grant you a free spin and non matching numbers will respond with bad luck
    local value1 = math.random(1, 10)
    local value2 = math.random(1, 10)
    local value3 = math.random(1, 10)
    if true then
    print(value1, value2, value3)
    end
    if value1 == 7 and value2 == 7 and value3 == 7 then
    print("Jackpot!")
    elseif
    value1 == value2 and value2 == value3 then
    print("You got a small prize!")
    elseif value1 == 10 or value2 == 10 or value3 == 10 then
    print("You got a free spin!")
    else
    print("Bad luck!")
    end