Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do i make math random follow like what i want?

Asked by 3 years ago

Hi, I am trying to make the impossible hallway, and if the player steps on a part the color of the hallway change to make it look infinity. Anyways here's my script

local part = script.Parent
local player = game.Players.LocalPlayer

game.Workspace.Part.Touched:Connect(function(hit)
    local hum = hit.Parent:FindFirstChild("Humanoid")
    if (hum~=nil) then
        local changer = math.random(1,2)
        if changer = 1
            then game.Workspace.colorchange.BrickColor = BrickColor.new(3,3,3)


    end
end)


i am new to lua coding so i dont know how to make it like if the math.random number is 1 then the hallway becomes yellow somethin like that

0
i realized brickcolor was supposed to be color name not code skeletonpiratejack 13 — 3y
0
You need to do script.Parent, You need to realize how many "Part"'s Is in the Workspace RektwayYTB 123 — 3y

Answer this question