RoboGean
|
  |
| Joined: 24 Mar 2011 |
| Total Posts: 577 |
|
|
| 16 Jan 2015 09:42 PM |
| Is it possible to put a script in a Part that only allows anything to pass through it except a part named "Ball"?? I'm really trying to figure this out. |
|
|
| Report Abuse |
|
|
| 16 Jan 2015 09:46 PM |
DB = true
script.Parent.Touched:connect(function(h) if DB and h.Name ~= "Ball" then DB = false script.Parent.CanCollide = false script.Parent.TouchEnded:wait() script.Parent.CanCollide = true DB = true end end) |
|
|
| Report Abuse |
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
|
| 16 Jan 2015 10:20 PM |
local db = false local key = "Ball"
function fade(part,start,endd,incr,float,sett) for i = start,endd,incr do part.Transparency = i wait(float) end part.CanCollide = sett end
script.Parent.Touched:connect(function(hit) if db = false then db = true if hit.Name == key then if script.Parent.Transparency > 0 then fade(script.Parent,0,1,.1,.1,false) wait(1) fade(script.Parent,1,1,-.1,.1,true) end else fade(script.Parent,0,1,.1,.1,false) wait(1) fade(script.Parent,1,1,-.1,.1,true) end end db = false end end) |
|
|
| Report Abuse |
|