To be more specific, I have this quiz, that is so far made up of only one question. What you're supposed to do, is do what a ScreenGui tells you. In this case, I have 3 bricks, all of different colors. The Gui says to step on the green one. So when you step on the green, the gui's text says "Good!", and if I step on a different brick, it says "Wrong!". The problem here is that, if I step on the green one, and then I step on another brick, the "Good!" swtiches to "Wrong!" and this is because the other scripts still work, even though I activated the first one. What I want is that the brick's scripts don't work if I'm stepping on a different brick. Here are the scripts:
Green Brick:
local part = script.Parent
local db = false
local msg = game.Workspace.Board.SurfaceGui.TextBox
local b = game.Workspace.Board
function CheckColor(hit)
local human = hit.Parent:FindFirstChild("Humanoid")
if not db then
if human then
db = true
msg.Text = ("Good job!")
wait(2)
msg.Text = ("You can pass!")
wait(2)
msg.Visible = false
for i = 0,1, 0.1 do
b.Transparency = i
wait(0.1)
end
b.CanCollide = false
wait(3)
b.CanCollide = true
b.Transparency = 0
msg.Visible = true
msg.Text = ("Step on the green brick.")
db = false
end
end
end
part.Touched:connect(CheckColor)
Red and Yellow brick:
local part = script.Parent
local db = false
function CheckColor(hit)
local human = hit.Parent:FindFirstChild("Humanoid")
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if not db then
if human then
db = true
game.Workspace.Board.SurfaceGui.TextBox.Text = ("Wrong!")
wait(2)
player:LoadCharacter()
game.Workspace.Board.SurfaceGui.TextBox.Text = ("Step on the green brick.")
db = false
end
end
end
part.Touched:connect(CheckColor)

2 comments
Don't use three separate scripts. Use one script. Or make a BoolValue in workspace called "Debounce"
http://wiki.roblox.com/index.php?title=Debounce#Advanced_notation