This is script is supposed to make a THIRSTGUI go up when I touch ANY brick with the name water. However, it doesn't work. It has no errors in console. This is a LOCAL SCRIPT.
local block = "Water"
wait(1)
local debounce = false
local thirst = game.Players.LocalPlayer:WaitForChild("ThirstVal")
repeat wait() until game.Players.LocalPlayer.Character
local character = game.Players.LocalPlayer.Character
game.Players.LocalPlayer.Character.HumanoidRootPart.Touched:connect(function(p)
if p.Name == block then
thirst.Value = thirst.Value + 10
if thirst.Value > 100 then
thirst.Value = 100
end
end
end)

5 comments
connect is deprecated, use Connect
still doesn't work
If this is located somewhere within Workspace then that might be your issue. Try moving it into StarterPlayer > StarterPlayerScripts.
You could also try print debugging
1 broken line of code = all the local script's code source will not work properly.