The function used to do this is remotefunction invokeclient.
Roblox remote functions. Invoking a client is very similar to invoking the server except in this case the invocation has to pass the player to invoke. 1 functions 1 1 tuple invokeclient instance player tuple arguments yields 1 2 tuple invokeserver tuple. Allow functions defined in one script to be called by another script across client server boundary. Local replicatedstorage game getservice replicatedstorage local remoteevent replicatedstorage waitforchild remoteeventtest create a new part local function oncreatepart player partcolor partpos print player name.
Like bindablefunction a remotefunction can be invoked called to do a certain action and return the results. This class was added in version 0 123. When a client wants to use a remote function it will invoke the server with the remotefunction invokeserver function within a localscript. Remote functions are used to trigger actions on the server from the client and to return back information from the server to the client like two way communication.
Welcome back to another roblox scripting tutorial a. When the server is invoked it will execute the bound function. Unlike remoteevents remotefunctions can send information back to the client such as items in a shop stored on the server. Learn how to use remote functions in roblox with this video.
The server listens for this function to be invoked by binding a function to remotefunction onserverinvoke using the assignment operator and not with an event within a script. Fired the remote event local newpart instance new part newpart brickcolor partcolor newpart position partpos newpart parent workspace end call oncreatepart when the client fires the remote event remoteevent onserverevent connect oncreatepart. A remotefunction is used to create in game apis that both the client and the server can use to communicate with each other.