I tired use return math but its not working no its working only one time
local math = math.random(1,2)
local click = script.Parent.ClickDetector
local function baseplatecolor(color)
if math == 1 then
game.Workspace.Baseplate.Color = Color3.fromRGB(0,255,0)
end
end
local function baseplatecolor1(color2)
if math == 2 then
game.Workspace.Baseplate.Color = Color3.fromRGB(255,0,0)
end
end
click.MouseClick:Connect(baseplatecolor)
click.MouseClick:Connect(baseplatecolor1)
local click = script.Parent.ClickDetector
local function baseplatecolor(color)
local math = math.random(1, 2) -- randomize number every time
if math == 1 then
game.Workspace.Baseplate.Color = Color3.fromRGB(0,255,0)
elseif math == 2 then -- merged into one function
game.Workspace.Baseplate.Color = Color3.fromRGB(255,0,0)
end
end
click.MouseClick:Connect(baseplatecolor)