I got that marketplace system where I just run it everytime i want. It checks if the players owns the gamepass , or if he’s in the owners table to receive the gamepasses basically when calling the functions UserOwnsAsyncGamepass. My issue is when i try to fire that it says “FireServer can only be called from the client”
https://create.roblox.com/docs/reference/engine/classes/ModuleScript
“It’s important to know that return values from ModuleScripts are independent with regards to Scripts and LocalScripts, and other environments like the Command Bar. Using require() on a ModuleScript in a LocalScript will run the code on the client, even if a Script did so already on the server. Therefore, be careful if you’re using a ModuleScript on the client and server at the same time, or debugging it within Studio.”
In your module, you create a MarketplaceService:UserOwnsGamePassAsync wrapper. You’re requiring this module from a Script
, however, which leads to it being executed from the server. As the error states, RemoteEvent:FireServer can only be called from the client. I doubt I need to explain why that is
It’s unclear why you’re involving the server here. If you intend to make an additional UserOwnsGamePassAsync
call, know that the server is no more knowledgeable than the client in terms of game-pass ownership:
Your best solution is to eliminate this part of your wrapper function
Basically I have an gamepass gifting system, I use fire to send that i need the info and under I use OnClientEvent wait for the response (true or false) which goes to has value. Tried using a remote function but didn’t work.
Are you querying a data-store for whether or not the user owns the game-pass?
This code should be executed for the server as well, should it make a call to your wrapper function. You can use RunService:IsServer to set up sections in your module that should only be executed if the calling code is server-sided
That doesnt work too it’s like never a server or something. Tried using fire client but to access datastore i need it to be a server
You’re not implementing it correctly then
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.