I made a debounce that stops the Part from turning transparent if touched then once and then turn visible if it's done being touched,but it won't turn visible,why? Please show how you managed to fix it.
local Part = script.Parent Touched = false ----------------------------- 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.." !") else if not Touched then -- If not touched ----------------------------- Part.TouchEnded:connect(function(TouchEnd)--If the touch has ended then do the following print("I haven't been touched!") Part.Transparency = 0 Touched = false end) ----------------------------- else--If it's still touched then do the following Part.Transparency = 0.5 print("I've been touched") Touched = false end end end)
I was here before but this should help ;)
local Part = script.Parent Touched = false ----------------------------- 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.." !") else ----------------------------- Part.Transparency = 0.5 print("I've been touched") Touched = false end end) Part.TouchEnded:connect(function(TouchEnd)--If the touch has ended then do the following print("I haven't been touched!") Part.Transparency = 0 Touched = false end)