Hmm: Argument 1 missing or nil

-- Services

local plrs = game:GetService("Players")

local rs = game:GetService("ReplicatedStorage")

-- Vars

local getData = rs:WaitForChild("GetData")

-- Gui Vars

-- Init

local function Init()

getData:InvokeServer()

end

Init()

Server:

rs.GetData.OnServerInvoke = HandleRequest

Getting error (‘Argument 1 missing or nil’) on getData:InvokeServer()

I think you need the player argument inside of the InvokeServer args

1 Like

Can you post the HandleRequest function.

No you do not, it is automatically added in from the client.

Made sure, it actually is a localscript, you put this in?

It is. asdkasdgasdjkasdkjasdas

Sorry but no, the HandleRequest function has APIKeys and tokens.

He would not get that error then, invoke server cannot be called from the server, the error is most likely in the handle request function.

Then you will not get an answer because that is where the error is. In the future if you have a problem sharing your code then you can’t expect to get help.

local function HandleRequest()

TModule:HandleRequest()

end

Just copy the code, and change/remove the APIKeys and tokens, so we won’t see them.

Can you post that HandleRequest function from the module and format your code properly.

I think there is problem in server script not in local script.

Can you show us the actual error - screenshot the output log for that particular error showing the stack trace.

Can you also stop editing your code so heavily - the problem is with your code how it is in the game - if you keep redacting huge portions there’s absolutely no way to find the issue. Replace any sensitive keys or URLs with empty strings or, as per best practice, these should be set to constants/variables rather than being hardcoded in.

By the time you’ve handwritten the error, edited the code, and formatted it inconsistently, it’s so far removed from what you actually have that you’re not going to get any solid answers.

Where is your player argument? You need to know which player it’s from.

Everyone saying you need to supply a player argument into the client invocation, no, player is automatically passed in as the first parameter

Then don’t tell us the API keys and tokens. Just remove the API keys and tokens and paste it here but not on the actual script.

It’s needed on the server side function.

There’s the () missing or you already have it?