Another person had asked a similar question. I had replied with the following example. I don't really understand what you are looking for but take a look at my example. Comment below if that is not what you are looking for.
To show you an example, I have 2 Bricks in Workspace, named ClickBrick and ChangeColour. When clicked on the ClickBrick it will result in printing, "Brick is Clicked". Then when clicked on the ChangeColour Brick, the brick will change into red colour.
When you press the ChangeColour Brick first, it will not change its colour because it is inside the Click Brick's code.
local Workspace = game:GetService("Workspace")
local button = Workspace:WaitForChild("ClickBrick")
local ColourChanger = Workspace:WaitForChild("ChangeColour")
changePartColour = function()
print("It is clicked!")
local function changeBrickColour ()
ColourChanger.BrickColor = BrickColor.Red()
print("Changed to red colour!")
end
ColourChanger.ClickDetector.MouseClick:Connect(changeBrickColour)
print("Continue your code below here.")
wait(5)
ColourChanger.BrickColour = BrickColor.Gray()
end
button.ClickDetector.MouseClick:Connect(changePartColour)
##There is another technique in how you would perform the same task. Spawn is used to embed another function inside a function
local function PrintSomeText()
spawn(PrintText)
print("This printed")
end
local function PrintText ()
wait(1)
print("Hello World!")
end
PrintSomeText()
##Is this what you wanted? Let me know if it didn't help you.
1 comment
It doesn't 'stop', it waits for ontwo to finish