|
| 01 Jan 2012 10:07 PM |
| I needed two scripts to share a mouse, one can get it and the other can't, so I used an ObjectValue. It worked fine when I did Test>Play Solo, but when I'm doing it in Play mode it's not working. Are you able to do this on a server, or do I have to use _G? |
|
|
| Report Abuse |
|
|
| |
|
|
| 01 Jan 2012 10:42 PM |
| Impossible, trust me I have tried about 100 ways of doing this and they all failed. |
|
|
| Report Abuse |
|
|
|
| 01 Jan 2012 10:43 PM |
"Are you able to do this on a server, or do I have to use _G?"
Even _G wouldn't work.
Trust me, there's probably no way at all to do it. |
|
|
| Report Abuse |
|
|
| |
|
|
| 01 Jan 2012 10:51 PM |
| Wait.. blobbyblob did it, I think. |
|
|
| Report Abuse |
|
|
|
| 01 Jan 2012 10:56 PM |
| I have passed my mouse to another script in the beginning of my scrolling RPG. I made a global function in the gui script called _G.KeyDown and _G.MouseDown and the Up versions of these functions. When pressed it calls the function and the keys are added to a table and the mouse is sent to a variable and a boolean of whether the mouse is down or not is updated. If anyone wants these functions just post. |
|
|
| Report Abuse |
|
|
|
| 01 Jan 2012 10:57 PM |
| Even though it wouldnt be too hard to remake them. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 10 Jan 2012 04:40 PM |
print(_G[script.Parent.Parent.Parent.Parent.Parent.Name.."Mouse"]().Name) --prints "Instance" _G[script.Parent.Parent.Parent.Parent.Parent.Name.."Mouse"]().KeyDown:connect(function(key) print("IN IT") --Does not print
What is this? |
|
|
| Report Abuse |
|
|
|
| 10 Jan 2012 05:09 PM |
I don't even...
~ 10 chicken goto 20 wing ~ |
|
|
| Report Abuse |
|
|
|
| 10 Jan 2012 05:24 PM |
| Never mind, I got it to work. I just needed to put it in a LocaLscript. |
|
|
| Report Abuse |
|
|
blockoo
|
  |
| Joined: 08 Nov 2007 |
| Total Posts: 17202 |
|
|
| 10 Jan 2012 09:40 PM |
| I did it with an ObjectValue, and it's quite easy. You just need a LocalScript. I suppose _G works just as well though. |
|
|
| Report Abuse |
|
|
stravant
|
  |
 |
| Joined: 22 Oct 2007 |
| Total Posts: 2893 |
|
|
| 10 Jan 2012 09:48 PM |
You can see an example of me doing this on my "Cn V" tests place. it does everything 100% on the server and it has a "Replicator" localscript in a tool that sends all the events to the server via boolvalue/objectvalue/vector3value changes.
It makes it have a bit of a delay but if there's a lot of global state it's unfortunately the only reasonable way to do things. |
|
|
| Report Abuse |
|
|
HeckBlock
|
  |
| Joined: 09 Jan 2012 |
| Total Posts: 36 |
|
|
| 11 Jan 2012 06:58 AM |
| I thought i saw a place that did this? its not impossible or easy.. |
|
|
| Report Abuse |
|
|