I wrote this code, then I tested it. It worked, so I resize and play around with the part, and it suddenly stops working! Here is my code (Code block was too small, it shifted some things so sorry if it is messy):
script.Parent.Touched:Connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
player.PlayerGui.test1.safe.TextLabel.TextColor3 = Color3.fromRGB(31, 198, 28)
end)
script.Parent.TouchEnded:Connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
player.PlayerGui.test1.safe.TextLabel.TextColor3 = Color3.fromRGB(198, 52, 54)
end)
I want it so that when you touch the brick, there is a GUI that says safe. If you are outside of the brick (Not touching it) It would become red. If you are inside the brick (touching) then it is green. I can't figure this out.
I would really appreciate some help.

2 comments
I recommend making the debounce wait atleast a second for better performance.
Ok, I'll try that! Thanks for the suggestion!