I have been working on this piece of code, and I've come accross a bug, I believe. Here's the script.
local CompletedStage3 = false
script.Parent.Text = " "
Humanoid.WalkSpeed = 16
Humanoid.JumpPower = 50
workspace.Stage3KeycardPart.Success.Changed:Connect(function()
if workspace.Stage3KeycardPart.Success.Value == true then
CompletedStage3 = true
for i = 1,#SuccessStage3 do
script.Parent.Text = string.sub(SuccessStage3,1,i)
workspace.Typing:Play()
wait()
end
else
CompletedStage3 = true
for i = 1,#FailureStage3 do
script.Parent.Text = string.sub(FailureStage3,1,i)
workspace.Typing:Play()
wait()
end
end
end)
if CompletedStage3 == true then
print("completed")
end
It is supposed to work, and it shows nothing in the output. No warnings, errors or prints. Any help please?

1 comment
Have you done any print testing(should do when having problems around if statements)...its hard for me to help you when I dont know the value of stage3keycardpart