smunkey
|
  |
| Joined: 17 Dec 2011 |
| Total Posts: 342 |
|
|
| 14 Aug 2014 02:49 PM |
I have been working for some time now on a brick that will disappear then up a value by one, however closest to working I can get it is this.
function clicked() local g = _G.grain g = g + 1 _G.grain = g
end
script.Parent.ClickDetector.MouseClick:connect(clicked)
It is in a normal script inside of a brick. Inside the brick is another normal script (that works 100% fine) that makes it disappear for 300 seconds upon being clicked.
Somewhere else is a script containing
_G.grain = 0 _G.lpc = 50
What is wrong with my script and how do I fix it? |
|
|
| Report Abuse |
|
|
smunkey
|
  |
| Joined: 17 Dec 2011 |
| Total Posts: 342 |
|
| |
|
smunkey
|
  |
| Joined: 17 Dec 2011 |
| Total Posts: 342 |
|
| |
|
cade2000
|
  |
| Joined: 09 Aug 2009 |
| Total Posts: 887 |
|
|
| 15 Aug 2014 12:05 AM |
If a script only works in studio it's generally because it's a local script that should be a server script or the other way around.
"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - Martin Golding |
|
|
| Report Abuse |
|
|
smunkey
|
  |
| Joined: 17 Dec 2011 |
| Total Posts: 342 |
|
|
| 15 Aug 2014 03:03 PM |
| it is a server script, but when I tried changing it too local it wouldn't even work in studio. |
|
|
| Report Abuse |
|
|
smunkey
|
  |
| Joined: 17 Dec 2011 |
| Total Posts: 342 |
|
| |
|