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 events, args...

Previous Thread :: Next Thread 
KOzero is not online. KOzero
Joined: 11 May 2010
Total Posts: 1411
18 Sep 2014 04:08 AM
How do I send argument such as strings, numbers, objects from Server> Client or the opposite?
I've attempted to do it several times and I'm getting no where, I checked the wiki but it seems I'm still doing something wrong.
Please write an example and explain every line of code so I will be able to do it right when I'm on my own...
Report Abuse
Locard is not online. Locard
Joined: 13 Apr 2014
Total Posts: 3516
18 Sep 2014 05:22 AM
From Server to client...

SERVER
game:GetService'ReplicatedStorage'.RemoteEvent:FireClient(PLAYERNAME,tuple arguments)

CLIENT
game:GetService'ReplicatedStorage'.RemoteEvent.OnClientEvent:connect(function(tuple arguments)
end)

From client to server...

CLIENT
game:GetService'ReplciatedStorage'.RemoteEvent:FireServer(tuple arguments)

SERVER
game:GetService'ReplicatedStorage'.RemoteEvent.OnServerEvent:connect(function(PLAYER,tuple arguements)
--Keep in mind that the argument PLAYER will always be the player's instance from which the :FireServer() method was fired.
end)
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
18 Sep 2014 06:05 AM
I prefer RemoteFunctions.

RemoteFunction:FireServer(Args)
RemoteFunction.OnServerInvoke = function(Player, Args) print(Player, Args) end
Report Abuse
KOzero is not online. KOzero
Joined: 11 May 2010
Total Posts: 1411
18 Sep 2014 07:05 AM
What I wanted to do is send the args from the client to all the other clients,so it would be like this Client>Server>AllClients.
Module Scripts can't do this because a client can't access the Playerguiof another client.

Now here is my problem, Why are my arguments nil here?
I didn't bother, writing the property changes that were made

LocalScript:
local Remotes = game.ReplicatedStorage.Remotes
Remotes.SendMsg:FireServer(Test.Text,Player.Name,Msg)
Remotes.MessageReceived.OnClientEvent:connect(function(...)
end)

ServerScript:
local Remotes = game.ReplicatedStorage.Remotes
game.ReplicatedStorage.Remotes.SendMsg.OnServerEvent:connect(function(Player,...)
print(1)--This prints
game.ReplicatedStorage.Remotes.MessageReceived:FireAllClients(...)
end)
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
18 Sep 2014 07:21 AM
Modulescripts only run once, so they wouldn't help anyways.
I'm not sure what's wrong with the script, I always use RemoteFunctions, and I am not too familiar with the ellipsis operator.
Report Abuse
KOzero is not online. KOzero
Joined: 11 May 2010
Total Posts: 1411
18 Sep 2014 07:28 AM
Mind explaining what the ellipsis operator is?
Report Abuse
KOzero is not online. KOzero
Joined: 11 May 2010
Total Posts: 1411
18 Sep 2014 09:02 AM
Nvm, it's the ...
Report Abuse
KOzero is not online. KOzero
Joined: 11 May 2010
Total Posts: 1411
18 Sep 2014 09:04 AM
I'm not the only person having this problem, I checked lua-users the website and found the exact same problem.
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