generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Remote Functions..

Previous Thread :: Next Thread 
KOzero is not online. 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 is not online. 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 is not online. KOzero
Joined: 11 May 2010
Total Posts: 1411
10 Sep 2014 01:29 PM
PlayerAdded is a remote function.
Report Abuse
KOzero is not online. 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 is not online. vlekje518
Joined: 10 Apr 2011
Total Posts: 191
10 Sep 2014 01:35 PM
somehow it does.
Report Abuse
KOzero is not online. KOzero
Joined: 11 May 2010
Total Posts: 1411
10 Sep 2014 01:37 PM
Prove your statement.
Report Abuse
vlekje518 is not online. 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 is not online. 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
filiptibell is not online. filiptibell
Joined: 10 Mar 2013
Total Posts: 2362
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 is not online. vlekje518
Joined: 10 Apr 2011
Total Posts: 191
10 Sep 2014 01:53 PM
wut
Report Abuse
filiptibell is not online. filiptibell
Joined: 10 Mar 2013
Total Posts: 2362
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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image