kokko1234
|
  |
| Joined: 15 Jun 2012 |
| Total Posts: 39 |
|
|
| 22 Dec 2016 08:08 AM |
How can i make this stop blinking?
part.Touched:connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then part.Transparency = 1 end end)
part.TouchEnded:connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then part.Transparency = 0 end end) |
|
|
| Report Abuse |
|
|
|
| 22 Dec 2016 08:13 AM |
You need a debounce
Currently it is changing everytime any part of the humanoid touches your part
local debounce = false local hitpart part.Touched:connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") and not debounce then debounce = true hitpart = hit part.Transparency = 1 end end)
part.TouchEnded:connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") and hit == hitpart and debounce then debounce = false part.Transparency = 0 end end) |
|
|
| Report Abuse |
|
|
kokko1234
|
  |
| Joined: 15 Jun 2012 |
| Total Posts: 39 |
|
| |
|