#Remote Events

1 messages · Page 1 of 1 (latest)

little kestrel
#

I am firing a remote event in a local script, which links to a server script that uses a module script upon receiving the event.

Is there a way to skip the middle part, i'll send screenshots to explain

glass ridge
#

u kinda can

#

if u require the module at the beggining of the script

#

u can put the OnserverRemote on the module

#

it would work fine

#

I think u can

#

cus I use Players.PlayerAdded in there

#

works fine

#

I usually just require the module

#

to save time

little kestrel
#

It looks really messy, is it better if I just scrap the module script

little kestrel
glass ridge
#

if the module is on the server ofc

little kestrel
#

Yeah

rich lark
little kestrel
rich lark
glass ridge
#

yea

little kestrel
#

Alright hold on let me try this

#

Is there a way to just call a function in the module script from a client but have it run on the server?

#

Like

#

Client:

Module.Function(A,B)

Module Script:

Module.Function = function(A,B)
--> Runs on the server

#

or do i have to use remote events

glass ridge
#

u gotta use remotes

little kestrel
#

Aight

#

My script is in replicatedstorage

#

and it says i cant only use onserverevent on the server

#

is that because its in replicated storage

#

or because its a module script

rich lark
little kestrel
#

and if its because its in replicated storage i'll just forget it for now

rich lark
#

If it is, its more likely only made it be used By LocalSCripts

#

😭

little kestrel
#

because it will take ages to change all the scripts that require modules

little kestrel
rich lark
#

if thats what u wanna do then go ahead

#

but the difference is, Modules can either be by Client Only or Server Only

#

From what i know so far

rich lark
little kestrel
#

My module creates hitboxes when the functions are called on a server script

rich lark
#

im confused by this

#

😭

little kestrel
#

And here is the line i replaced

rich lark
#

and require it through there

little kestrel
#

but if its required to do then i don't mind

rich lark
little kestrel
#

Wait

rich lark
#

Literally use Folders for it 😭

little kestrel
#

its just a long line of this

#

I check the input on the client

#

I fire a remote event if something needs to be done on the server

rich lark
little kestrel
#

and then i connect the module

#

No

#

A seperate server script

rich lark
#

oh ok

#

ok ok ok

little kestrel
#

If there is nothing i can do its fine

rich lark
#

so just place it in the serverscriptservice

little kestrel
#

it works#

rich lark
#

then change the variable to require it to where the module is now located

little kestrel
#

Alright

rich lark
#

Cause if your using Server only Stuffs e..g; OnServerEvent

little kestrel
#

Honestly i don't know if there is a point of keeping all this stuff in a module script anymore but i might as well

rich lark
#

whilist its in a ClientOnly path or only clients can use

#

Like ReplicatedStorage ( i think when placing a module there its only for clients )

#

then it wont work

little kestrel
#

aight

#

ty

rich lark
#

Np!

#

nevermind, ReplicatedStorage can be required via server or clients

#

but your using server only functions