0

# How to do client-server communication and replication?

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.

1
NykoVania 198
16 days 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 — 16d
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 — 15d
0
Use a table or something NykoVania 198 — 15d
0
How? Make an example, please. GulgPlayer 17 — 14d
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 2641 — 14d