Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to do client-server communication and replication?

Asked by 2 years ago

Hello!

I'm trying to make a free to use engine which may help developers to simplify Roblox modules and scripts creation which is named RoApp.

I want to developers import RoApp, and used it just like this:

local app = RoApp.new("AppName", RoApp.Module)
function app.InitClient(player)
    ...
end
function app.InitServer()
    ...
end

I made it, but I can't made InitClient function. The function is defined in server script but it has to be a local script. There isn't a way to just send function by remote event or something like that.

Is there ways to do it?

Thank you.

2 answers

Log in to vote
1
Answered by
NykoVania 231 Moderation Voter
2 years ago

Try making it a ModuleScript so that both the server and client can access it

0
This is exactly what I was going to say. You could do that and have it so that only the client can access the client functions and properties and then the server can only access the server. MrLonely1221 701 — 2y
0
Yes, I was thinking about this but I don't know how to save data in module. If I do this on server: require(module).x = 4, I can't do this on client: print(require(module).x) GulgPlayer 17 — 2y
0
Use a table or something NykoVania 231 — 2y
0
How? Make an example, please. GulgPlayer 17 — 2y
0
Having a module interact with the same data in the client and server would make exploiting easy so instead you might have to just rely on using that specific part of the module in a server script greatneil80 2647 — 2y
Ad
Log in to vote
1
Answered by 2 years ago

Here's a few links to some resources to see if these would help. Link1 Link2 Hope these help and are what your looking for if they don't maybe post a question on the Roblox devforum if you don't get any answers in the next few days.

0
Sorry, but this isn't what I need. GulgPlayer 17 — 2y

Answer this question