Beauu
|
  |
| Joined: 25 Nov 2011 |
| Total Posts: 214 |
|
|
| 28 Nov 2011 10:30 AM |
This is a logic script, it only deals with two physical parts. It's main purpose is to switch on/off the _G.dream variable and it's always returning false when it prints. :'( All I get is:
Five seconds: false Five seconds: false Five seconds: false Five seconds: false Five seconds: false Five seconds: false
Here is the script:
old_d = false; script.Parent.Touched:connect(function(p) if (p.Name == 'platform') then old_d = _G.dream _G.dream = true; table.insert(_G.dt, p.Name..''..tostring(#_G.dt)) end end) script.Parent.StoppedTouching:connect(function(p) if (p.Name == 'platform') then old_d = _G.dream _G.dream = false; end end) t = 0; while (wait(1)) do t = t + 1 if (t == 5) then print(_G.dream) elseif (not t == 5 and not old_d == _G.dream) then print(_G.dream) end end
How can decide over what's right, when you're clouding up my mind? |
|
|
| Report Abuse |
|
|
Beauu
|
  |
| Joined: 25 Nov 2011 |
| Total Posts: 214 |
|
|
| 28 Nov 2011 10:31 AM |
My bad, wrong script.
old_d = false; script.Parent.Touched:connect(function(p) if (p.Name == 'platform') then old_d = _G.dream _G.dream = true; table.insert(_G.dt, p.Name..''..tostring(#_G.dt)) end end) script.Parent.StoppedTouching:connect(function(p) if (p.Name == 'platform') then old_d = _G.dream _G.dream = false; end end) t = 0; while (wait(1)) do t = t + 1 if (t == 5) then t = 0; print('Five seconds: '.. tostring(_G.dream)) elseif (not t == 5 and not old_d == _G.dream) then print('Changed: '.. tostring(_G.dream)) end end
How can decide over what's right, when you're clouding up my mind? |
|
|
| Report Abuse |
|
|
Miro034
|
  |
| Joined: 07 Oct 2009 |
| Total Posts: 6568 |
|
|
| 28 Nov 2011 12:06 PM |
| @_@ what is 'StoppedTouching' event? |
|
|
| Report Abuse |
|
|
Beauu
|
  |
| Joined: 25 Nov 2011 |
| Total Posts: 214 |
|
|
| 28 Nov 2011 12:08 PM |
It's in the ObjectBrowser.
~How can decide over what's right, when you're clouding up my mind? |
|
|
| Report Abuse |
|
|
eJorge
|
  |
| Joined: 09 Jun 2011 |
| Total Posts: 5966 |
|
|
| 28 Nov 2011 01:45 PM |
| I suggest using TouchEnded, never heard of StoppedTouching... |
|
|
| Report Abuse |
|
|
Beauu
|
  |
| Joined: 25 Nov 2011 |
| Total Posts: 214 |
|
|
| 28 Nov 2011 02:08 PM |
Pretty sure it's on there....
~How can decide over what's right, when you're clouding up my mind? |
|
|
| Report Abuse |
|
|
Beauu
|
  |
| Joined: 25 Nov 2011 |
| Total Posts: 214 |
|
|
| 28 Nov 2011 02:11 PM |
Oh. Lol. Nevermind. It's deprecated. Didn't see that.
~How can decide over what's right, when you're clouding up my mind? |
|
|
| Report Abuse |
|
|