I was making a script where if a Character touches the part it will turn half transparent and then it will go back to normal if he leaves the part but it won't go back to normal,why?
local Part = script.Parent
local Touched = false--Debounce
Part.Touched:connect(function(TouchedPart)
Touched = true
FoundHumanoid= TouchedPart.Parent:FindFirstChild("Humanoid")--Checks if it's a humanoid
if not FoundHumanoid then
print("You're not a Character "..TouchedPart.Name.." !")
Touched = false
else
if not Touched then
print("I haven't been touched!")
Part.Transparency = 1
else
Part.Transparency = 0.5
print("I've been touched")
Touched = false
end
end
end)

1 comment
This script has been fixed