-
What do you want to achieve? Keep it simple and clear!
Making a script that checks if an input of buttons is the same as the intended order(like blue then red then green then yellow, its random each time). -
What is the issue? Include screenshots / videos if possible!
everything works but when I compare my variable “currentorder” to “goodorder”, I get no error and the code never works(even though it should), and I have no idea why(tried debugging, the values are the same) -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
Switching some other variables, changing “goodorder” to an IntValue and NumberValue, same result.
local yellow = game.Workspace.xylophonestage1:WaitForChild("yellow").ClickDetector
local green = game.Workspace.xylophonestage1:WaitForChild("green").ClickDetector
local red = game.Workspace.xylophonestage1:WaitForChild("red").ClickDetector
local goodorder = game.Workspace.order1
local currentorder = 0
local size = 0
blue.MouseClick:Connect(function()
size += 1
if currentorder == 0 then
currentorder = 11
else
currentorder = currentorder..size..1
end
if size == 4 then
if currentorder == goodorder.Value then
print("good job!")
else
print("bad job :(")
end
print(currentorder.." "..goodorder.Value)
size = 0
currentorder = 0
end
end)
yellow.MouseClick:Connect(function()
size += 1
if currentorder == 0 then
currentorder = 12
else
currentorder = currentorder..size..2
end
if size == 4 then
if currentorder == goodorder.Value then
print("good job!")
else
print("bad job :(")
end
print(currentorder.." "..goodorder.Value)
size = 0
currentorder = 0
end
end)
green.MouseClick:Connect(function()
size += 1
if currentorder == 0 then
currentorder = 13
else
currentorder = currentorder..size..3
end
if size == 4 then
if currentorder == goodorder.Value then
print("good job!")
else
print("bad job :(")
end
print(currentorder.." "..goodorder.Value)
size = 0
currentorder = 0
end
end)
red.MouseClick:Connect(function()
size += 1
if currentorder == 0 then
currentorder = 14
else
currentorder = currentorder..size..4
end
if size == 4 then
if currentorder == goodorder.Value then
print("good job!")
else
print("bad job :(")
end
print(currentorder.." "..goodorder.Value)
size = 0
currentorder = 0
end
end)
(it always returns bad job)