Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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.

2 answers

✓ Accepted answer

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

5 comments

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.

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)

0

Use a table or something

0

How? Make an example, please.

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

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.

1 comment

0

Sorry, but this isn't what I need.

This discussion is preserved as it was. New answers, comments, and votes are closed.