I made this script which goes in a brick. The script should check in startergui if the gui stated in it has the text "-[Completed]." If the text says completed then the brick would be cancollidable.
local debounce = false
script.Parent.Touched:connect(function(hit)
if debounce == false then
wait()
debounce = true
local player = game.Players:FindFirstChild(hit.Parent)
if player and Startergui.Quests[player.Name].Frame6.quest6.Value == "-[Completed]" then
script.Parent.CanCollide = false
wait(.5)
script.Parent.CanCollide = true
end
--I placed the debounce inside the if statement, so that it only gets reset by the function call that set it
wait(2)
debounce = false
end
end)

2 comments
Not sure why it didn't work. So basically the Frame6.quest6 is a gui which normally says "-None" but if you touch a brick then it changes to "-[Completed]." So I want the block to only become cancollidable if the gui says Completed but I'm not sure what I'm doing wrong.
Alright, if you can edit the script so that I can see the part that changes the text in the GUI I could help you further.