Hello me and a friend are currently making a game but we are not scripting geniuses, so we need help to make a minigame. The minigame is Simon says and we want the script to be activated(and/or stop)when the button is pressed. Here is the script for the Simon says:
Command = script.Parent.SurfaceGui
Blue = script.Parent.Parent.Parent.Parent.Blue
Green = script.Parent.Parent.Parent.Parent.Green
Red = script.Parent.Parent.Parent.Parent.Red
Yellow = script.Parent.Parent.Parent.Parent.Yellow
wait(8)
script.Parent.Parent.Parent.Parent.Floor:Destroy()
while true do
wait(1)
RandNum = math.random(1, 4)
if RandNum == 1 then
Command.TextLabel.TextColor3 = Color3.new(0, 1, 1)
Command.TextLabel.Text = "Stand on blue"
wait(2)
Green.CanCollide = false
Red.CanCollide = false
Yellow.CanCollide = false
wait(2)
Green.CanCollide = true
Red.CanCollide = true
Yellow.CanCollide = true
elseif RandNum == 2 then
Command.TextLabel.TextColor3 = Color3.new(0, 1, 0)
Command.TextLabel.Text = "Stand on green"
wait(2)
Blue.CanCollide = false
Red.CanCollide = false
Yellow.CanCollide = false
wait(2)
Blue.CanCollide = true
Red.CanCollide = true
Yellow.CanCollide = true
elseif RandNum == 3 then
Command.TextLabel.TextColor3 = Color3.new(1, 0, 0)
Command.TextLabel.Text = "Stand on red"
wait(2)
Green.CanCollide = false
Blue.CanCollide = false
Yellow.CanCollide = false
wait(2)
Green.CanCollide = true
Blue.CanCollide = true
Yellow.CanCollide = true
elseif RandNum == 4 then
Command.TextLabel.TextColor3 = Color3.new(1, 1, 0)
Command.TextLabel.Text = "Stand on yellow"
wait(2)
Green.CanCollide = false
Red.CanCollide = false
Blue.CanCollide = false
wait(2)
Green.CanCollide = true
Red.CanCollide = true
Blue.CanCollide = true
end
end
and here is the button script we are trying to attach
function onClicked(playerWhoClicked)
script.Parent.Transparency=1
--Put commands here
wait(1)
script.Parent.Transparency=0
--If you want the command to activate after the
--button is pressed, put the commands here instead.
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
end
end
and here is the button script we are trying to attach:
function onClicked(playerWhoClicked) script.Parent.Transparency=1 --Put commands here wait(1) script.Parent.Transparency=0 --If you want the command to activate after the --button is pressed, put the commands here instead. end script.Parent.ClickDetector.MouseClick:connect(onClicked)
end
end
Any help is appreciated.

2 comments
my gosh use a code block
Edited to add a code block.