Ginjji
|
  |
| Joined: 19 Jun 2011 |
| Total Posts: 7677 |
|
|
| 15 Nov 2014 02:12 PM |
print("Switch Effect loaded")
Touched(Instance hit) >> if(hit.Name=="pellet") dostuff(); script.Parent.Parent.Bridge.Transparency = 0 script.Parent.Parent.Bridge.CanCollide = true print("Switch is working") wait(15) script.Parent.Parent.Bridge.Transparency = 1 script.Parent.Parent.Bridge.CanCollide = false end
For line two Error: Expected ')' (to close'(' at column 8) got 'hit'
|
|
|
| Report Abuse |
|
|
Ginjji
|
  |
| Joined: 19 Jun 2011 |
| Total Posts: 7677 |
|
| |
|
lordrambo
|
  |
| Joined: 16 Jun 2009 |
| Total Posts: 20628 |
|
|
| 15 Nov 2014 02:40 PM |
script.Parent.Touched:connect(function(hit)--change script.Parent to where it's located if (hit.Name=="pellet") then --dostuff(); script.Parent.Parent.Bridge.Transparency = 0 script.Parent.Parent.Bridge.CanCollide = true print("Switch is working") wait(15) script.Parent.Parent.Bridge.Transparency = 1 script.Parent.Parent.Bridge.CanCollide = false end)
I don't know what language you're coming from but that's not how Rbx.Lua works. Also you'll probably want a debounce since ROBLOX will fire the Touched event multiple times at once. Look up "Debounce" on the wiki if the writers haven't gotten to messing with that yet. |
|
|
| Report Abuse |
|
|