Script is running into error about true being nil

Whenever I run this line:

if game["Run Service"]:IsClient() then
		if game.ReplicatedStorage.remote.Quests:FindFirstChild("CompEvent") then
			comp = game.ReplicatedStorage.remote.Quests.CompEvent:InvokeServer(true) --line 8
		end
	else
		comp = game.ServerStorage.Event.Quests.CompEvent:Invoke(player, true)
	end

It returns this error:

Argument 1 missing or nil  -  Client - QuestScript:8

How can true be nil or am I not understanding something. FYI: game.ReplicatedStorage.remote.Quests.CompEvent is not an event but a remote function

1 Like

Can you show the script?

Also remember that you cannot access serverstorage in a local script.

I would show the full script but its very long but here is it before that part

function module.spawn(player)
    local quests = {}
	quests[1] = {}
	local comp
	if game["Run Service"]:IsClient() then
		if game.ReplicatedStorage.remote.Quests:FindFirstChild("CompEvent") then
			comp = game.ReplicatedStorage.remote.Quests.CompEvent:InvokeServer(true)
		end
	else
		comp = game.ServerStorage.Event.Quests.CompEvent:Invoke(player, true)
	end

It used to work before but then suddely breaked with out good reasoning. Also its checking if its on the server or the client and requesting data accordingly there is no bug with that.

Does it work if you put something else other than true in the arguments?

just tested it with a string “true” and it still broke

Ok so then what happens when you add only a return and nothing else to the function that is hooked up to the on server invoke? I don’t really see a problem with that line of code so my guess is that it’s something to do with the function on the server that’s connected to the remote function. I could be completely wrong though.

The issue with server is that it goes through 100 functions to get data to return. This is what I think the issue is one of those functions is crashing.

But without those functions it works though right?