Hello, im trying to make a plugin. Im using events at some point. When I save the plugin it gives “OnServerEvent can only be used on the server” error. Im already using server script. Couple days ago it was working now, it doesn’t. Am i missing something, like i can’t use events at plugins?
Are you sending FireServer on client or server?
Sending from client, and getting from script inside plugin folder.
Hmm idk then maybe it just doesn’t send from client to script in a plugin?
Uhh, is this is a bug? It was working couple days ago -_-
Plugins in Studio run in the server context, thus OnServerEvent would not work. Why are you setting up remotes for plugins?
There is a case where plugins in Play Solo run in the client context alongside their server-side versions, but that’s a whole other ordeal.
Okay so what can i do now? It was working before. I need to send textbox information to server… I can’t save datastores from local.
Is this a plugin? Are you in Studio and not play solo? If so, you’re already in the server context
Its a datastore editor plugin, when you enter a key event fires.
But plugins run in server-side context, so you don’t need to fire any events. You can just call the DataStore from that context.
Sorry my first time at plugins, are you telling about saving from local script or just getting the text info from server script
Your plugin is not running on the client (unless you’re using it from Play Solo), so the code running in the plugin is in a server-side context. Therefore, your plugin has the ability to directly call the data store.
Okay, so im saving from local script right? Sorry im asking too much questions.