i need a script, remember there 3 button (Button1,Button2,Button3) in the map, when someone clicked the button1 it will be transparent to 1 and random change to other button(RANDOM 2 AND 3)(tranparent 0) position, if no one click button1 (60 second) it will transparent 1 and change other button(RANDOM 2 AND 3) position
just like the piggy game key random spawn position
local buttonFolder = script.Parent
local buttons = {buttonFolder.Button1,buttonFolder.Button2,buttonFolder.Button3}
local function onClicked(button)
if button.Transparency==0 then
button.Transparency = 1
local nextButton = button
while nextButton==button do
nextButton = buttons[math.random(1,3)]
end
nextButton.Transparency = 0
end
end
for _,part in buttons do
part.ClickDetector.MouseClick:Connect(function()
onClicked(part)
end)
part.Transparency=1
end
buttons[math.random(1,3)].Transparency=0