KOzero
|
  |
| Joined: 11 May 2010 |
| Total Posts: 1411 |
|
|
| 10 Sep 2014 01:03 PM |
What does this mean? >Output: OnClientInvoke is a callback member of RemoteFunction; you can only set the callback value, get is not available
ServerScript:
game.Players.PlayerAdded:connect(function(plr) if plr then return plr end game.ReplicatedStorage.Remotes.PlayerAdded:InvokeClient(plr) end)
LocalScript:
local players = {}
game.ReplicatedStorage.Remotes.PlayerAdded.OnClientInvoke:connect(function(x) table.insert(players, x) end)
game.ReplicatedStorage.Remotes.PlayerRemoved.OnClientInvoke:connect(function(x) table.remove(players, x) end) ------------------------------------------------------------------------------------ |
|
|
| Report Abuse |
|
|
Bobobob12
|
  |
| Joined: 23 Jan 2008 |
| Total Posts: 5350 |
|
|
| 10 Sep 2014 01:12 PM |
function game.ReplicatedStorage.Remotes.PlayerAdded.OnClientInvoke(x) table.insert(players, x) end |
|
|
| Report Abuse |
|
|
KOzero
|
  |
| Joined: 11 May 2010 |
| Total Posts: 1411 |
|
|
| 10 Sep 2014 01:29 PM |
| PlayerAdded is a remote function. |
|
|
| Report Abuse |
|
|
KOzero
|
  |
| Joined: 11 May 2010 |
| Total Posts: 1411 |
|
|
| 10 Sep 2014 01:31 PM |
| It's an anonymous function it doesn't need the term "function" before it... |
|
|
| Report Abuse |
|
|
vlekje518
|
  |
| Joined: 10 Apr 2011 |
| Total Posts: 191 |
|
| |
|
KOzero
|
  |
| Joined: 11 May 2010 |
| Total Posts: 1411 |
|
| |
|
vlekje518
|
  |
| Joined: 10 Apr 2011 |
| Total Posts: 191 |
|
|
| 10 Sep 2014 01:38 PM |
Prove it? Test it.
I've been working tons with RemoteFunctions/events lately, and i know they need specefic kind of things to work. |
|
|
| Report Abuse |
|
|
KOzero
|
  |
| Joined: 11 May 2010 |
| Total Posts: 1411 |
|
|
| 10 Sep 2014 01:46 PM |
| Do I also need to add a remote event then since the event is separately? |
|
|
| Report Abuse |
|
|
|
| 10 Sep 2014 01:51 PM |
Remote functions use callbacks, meaning they do not use an event and as such cannot use the connect method. Instead, you set a function that is ran each time the callback is... well... called :P
~The herp lerped a derp~ |
|
|
| Report Abuse |
|
|
vlekje518
|
  |
| Joined: 10 Apr 2011 |
| Total Posts: 191 |
|
| |
|
|
| 10 Sep 2014 02:00 PM |
You specify a function for the remotefunction, and that function is referred to as a "callback". But this can get confusing, since callbacks in other programming languages can be both asynchronous and synchronous (which is equivalent to events and callbacks respectively here in ROBLOX). Because ROBLOX that's why :c
~The herp lerped a derp~ |
|
|
| Report Abuse |
|
|
vlekje518
|
  |
| Joined: 10 Apr 2011 |
| Total Posts: 191 |
|
|
| 10 Sep 2014 02:03 PM |
No, I mean KOzero's last response, I don't get it. You cleaned up my memmory a bit tho, thx. |
|
|
| Report Abuse |
|
|