Tripane
|
  |
| Joined: 03 Jun 2011 |
| Total Posts: 11432 |
|
|
| 28 Dec 2014 12:23 PM |
don't link me to the wiki, because I didn't understand diddly squat from that
I have this gui that changes based on a value in workspace, and with filteringenabled on, it will not fire the changed event. how would remotefunctions/events solve this? can someone help apply this?
local val = workspace:FindFirstChild("TestVal") local label = script.Parent local labelval = label.RecieveVal
val.Changed:connect(function() labelval.Value = val.Value end)
labelval.Changed:connect(function() label.Text = labelval.Value end)
Like I said, it doesn't work with FE. |
|
|
| Report Abuse |
|
|
|
| 28 Dec 2014 12:25 PM |
That's probably because with FE, it only changes for the client that changes it.
Use RemoteFunctions or RemoteEvents.
Try re-reading it, and be patient.
http://wiki.roblox.com/index.php?title=RemoteFunction_and_RemoteEvent_Tutorial |
|
|
| Report Abuse |
|
|
Tripane
|
  |
| Joined: 03 Jun 2011 |
| Total Posts: 11432 |
|
|
| 28 Dec 2014 12:26 PM |
| I've legitimately read that four times, I just don't know how to apply it to my script |
|
|
| Report Abuse |
|
|
|
| 28 Dec 2014 12:29 PM |
RemoteFunctions: -InvokeClient (Method) -InvokeServer (Method) -OnServerInvoke (Callback) -OnClientInvoke (Callback)
RemoteEvents: -FireServer (Method) -FireClient (Method) -FireAllClients (Method) -OnServerEvent (Event) -OnClientEvent (Event)
I'm sure by now you know what an event is, so RemoteEvents would be the easiest to learn. Not that RemoteFunctions aren't easy though. |
|
|
| Report Abuse |
|
|
Tripane
|
  |
| Joined: 03 Jun 2011 |
| Total Posts: 11432 |
|
| |
|
Tripane
|
  |
| Joined: 03 Jun 2011 |
| Total Posts: 11432 |
|
|
| 28 Dec 2014 12:30 PM |
k gimme a few minutes
but uhm, in studio the whole thing forks even with FE on which is a problem because I can't test what works and what doesn't |
|
|
| Report Abuse |
|
|
|
| 28 Dec 2014 12:32 PM |
| That's because there is no client/server boundary on Studio. Try going to Test>Start Server and test it there, and if you need a client, go to Test>Start Client (I think) |
|
|
| Report Abuse |
|
|
Tripane
|
  |
| Joined: 03 Jun 2011 |
| Total Posts: 11432 |
|
|
| 28 Dec 2014 12:50 PM |
so if I did
game.Players.PlayerAdded:connect(function(p) p.PlayerGui:FindFirstChild("TestGui").TestEvent:FireClient end)
in a serverscript and
local ev = label.Parent.TestEvent ev.OnClientEvent:connect(function() labelval.Value = val.Value
would this work? |
|
|
| Report Abuse |
|
|
Tripane
|
  |
| Joined: 03 Jun 2011 |
| Total Posts: 11432 |
|
| |
|
iiEssence
|
  |
| Joined: 18 Jun 2014 |
| Total Posts: 3467 |
|
| |
|
|
| 28 Dec 2014 12:56 PM |
| Yes, that is correct, but you would need to wait for the event to appear in their GUI, since it doesn't load instantly. |
|
|
| Report Abuse |
|
|
|
| 28 Dec 2014 12:57 PM |
Oh wait, that wouldn't.
FireClient is an event, and you also need to specify which client.
:FireClient(game.Players.ExamplePlayer, Arg1, Arg2, Arg3, Arg4, et, cetera) |
|
|
| Report Abuse |
|
|
|
| 28 Dec 2014 12:57 PM |
op is not very smart
they're ez |
|
|
| Report Abuse |
|
|
Tripane
|
  |
| Joined: 03 Jun 2011 |
| Total Posts: 11432 |
|
|
| 28 Dec 2014 01:01 PM |
there's a difference between ignorance and idiocy, sir
so for the arguments, could I just use a for loop to loop through the players? |
|
|
| Report Abuse |
|
|
iiEssence
|
  |
| Joined: 18 Jun 2014 |
| Total Posts: 3467 |
|
|
| 28 Dec 2014 01:05 PM |
| You don't put the loop as the argument, but you are close sir |
|
|
| Report Abuse |
|
|
Tripane
|
  |
| Joined: 03 Jun 2011 |
| Total Posts: 11432 |
|
|
| 28 Dec 2014 01:29 PM |
oh god I still don't get it
can someone please help me apply this to my script |
|
|
| Report Abuse |
|
|
Tripane
|
  |
| Joined: 03 Jun 2011 |
| Total Posts: 11432 |
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 28 Dec 2014 04:14 PM |
'FireClient is an event, and you also need to specify which client.' uwot
OP think of RemoteFunctions/RemoteEvents as BindableFunctions/BindableEvents that can pass through to the server from the client or to the client from the server. When filtering is enabled, any changes the client makes won't be replicated to the server which is why, if you want others to see the changes, you have to use a RemoteFunction/RemoteEvent.
When you want the server to do something from the client, you call the appropriate method with any arguments you care to pass. For example, if I wanted the server to print Hello, world! using a RemoteEvent, I would attach a listener from the server on the RemoteEvent, like so:
remoteEvent.OnServerEvent:connect(function(client, msg) print(client.Name, "said:", msg); end);
And from the client I would invoke the server like this: remoteEvent:FireServer("Hello, world!");
And my output would be PlayerName said: Hello, world!
When you FireServer, the implied first argument is the client that called it. It gives you their player and all the arguments after it are the arguments you pushed.
When you want to send something to the client, from the server, you would use: remoteEvent:FireClient(client, "Hello, world!");
Where the first argument would be the player, and everything after it is whatever you want to pass. And a local script would handle like as such:
remoteEvent.OnClientEvent:connect(function(msg) print(msg); end); |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
| |
|