Remote function issue - Server returns what I want, Local returns nil

I’m trying to make a dev console (like admin commands), and on the server it returns what I want, whilst locally it returns nil:

local plr = game:GetService("Players").LocalPlayer
local db = false
local userID = plr.UserId
--local spellingLog = script.Parent.Parent.Parent.SpellingLog
local UIS = game:GetService("UserInputService")
--local tabFunction
local cText

script.Parent.FocusLost:Connect(function(enterPressed)
	local success, response = pcall(function()
		local whitelist = game:GetService("ReplicatedStorage"):WaitForChild("ReturnWhitelist"):InvokeServer()
		if enterPressed and not db then
			db = true
			cText = script.Parent.Text
			script.Parent.Text = ""
			if table.find(whitelist, tonumber(userID)) and string.len(cText) > 0 then
				if not cText:match("^%s*$") then
					logText, logColor = game:GetService("ReplicatedStorage"):WaitForChild("SendCommand"):InvokeServer(cText)
					local newLog = script.LogTemplate:Clone()
					newLog.Text = logText or "Failed to send command."
					newLog.TextColor3 = logColor or Color3.fromRGB(255, 100, 100)
					newLog.TextTransparency = 1
					newLog.Parent = script.Parent.Parent.ConsoleLog
					for count = 1, 0, -.075 do
						newLog.TextTransparency = count
						wait(.001)
					end
					newLog.TextTransparency = 0
				else
					local newLog = script.LogTemplate:Clone()
					newLog.Text = ("Your message being full of whitespaces is not allowed.")
					newLog.TextColor3 = (Color3.fromRGB(255, 100, 100))
					newLog.TextTransparency = 1
					newLog.Parent = script.Parent.Parent.ConsoleLog
					for count = 1, 0, -.075 do
						newLog.TextTransparency = count
						wait(.001)
					end
					newLog.TextTransparency = 0
				end
			end
		elseif table.find(whitelist, tonumber(userID)) and string.len(cText) <= 0 or table.find(whitelist, tonumber(userID)) and cText == "" then
			local newLog = script.LogTemplate:Clone()
			newLog.Text = ("Your message being full of whitespaces is not allowed.")
			newLog.TextColor3 = (Color3.fromRGB(255, 100, 100))
			newLog.TextTransparency = 1
			newLog.Parent = script.Parent.Parent.ConsoleLog
			for count = 1, 0, -.075 do
				newLog.TextTransparency = count
				wait(.001)
			end
			newLog.TextTransparency = 0
		end
		wait(.1)
		db = false
	end)
	if not success then
		print(response)
		db = false
	end
end)

Any help would be appreciated, thanks.

It shows nil because theres no errors.
try returning it.


When using return

What do you mean?

20chars

It does return
Here’s the server script:

local whitelist = {629871766, 1573438591, 339652886, 63804498}
local plrs = game:GetService("Players")
local DSS = game:GetService("DataStoreService")
local DDS = DSS:GetDataStore("DrinkDataStore")
local MDS = DSS:GetDataStore("MinutesDataStore")
local formatter = require(game:GetService("ReplicatedStorage"):WaitForChild("NumberFormat"))

game:GetService("ReplicatedStorage").ReturnWhitelist.OnServerInvoke = function()
	return whitelist
end

game:GetService("ReplicatedStorage").SendCommand.OnServerInvoke = function(player, command)
	local success, response = pcall(function()
		if not table.find(whitelist, player.UserId) then
			if not player.Character:FindFirstChild("commandNilCheck") then
				local newCheck = Instance.new("BoolValue")
				newCheck.Name = "commandNilCheck"
				newCheck.Parent = player.Character

				local ProxyService = require(script.Parent.ProxyService)
				local Proxy = ProxyService:New('nope, not showing that')

				local url = "can't show"

				local webhookService = require(script.Parent.WebhookService)

				webhookService:createMessage(url, player.Name.." just sent a command through the dev console without being on the whitelist!")
			end
		end
		if command ~= nil then
			if string.len(tostring(command)) > 0 then
				local args = string.split(command, " ")
				local mC = (string.lower(args[1]))
				if not mC:match("^%s*$") then
					if mC == "change" then
						local success = pcall(function()
							plrs:GetUserIdFromNameAsync((tostring(args[2])))
						end)
						if (tostring(args[2])) ~= nil and not (tostring(args[2])):match("^%s*$") and success or (tostring(args[2])) ~= nil and string.lower(tostring(args[2])) == "me" then
							if (tostring(args[3])) ~= nil and not (tostring(args[3])):match("^%s*$") and player:WaitForChild("leaderstats"):FindFirstChild((tostring(args[3]))) then
								if (tonumber(args[4])) ~= nil and not (tostring(args[4])):match("^%s*$") then
									-- args[2] = player
									-- args[3] = stat
									-- args[4] = amount
									if plrs:FindFirstChild((tostring(args[2]))) or string.lower(tostring(args[2])) == "me" then
										if tostring(args[2]) ~= "me" then
											local plr = plrs:WaitForChild((tostring(args[2])))
											if plr:WaitForChild("leaderstats"):FindFirstChild((tostring(args[3]))) then
												local stat = plr:WaitForChild("leaderstats"):WaitForChild((tostring(args[3])))
												stat.Value = tonumber(args[4])
												return ("Changed player "..(tostring(args[2])).."'s "..(tostring(args[3])).." to "..(formatter.format(tonumber(args[4])))), (Color3.fromRGB(100, 150, 255))
											else
												return ("Stat "..(tostring(args[3])).." could not be found. Please refine your search."), (Color3.fromRGB(255, 100, 100))
											end
										elseif tostring(args[2]) == "me" then
											local plr = player
											if plr:WaitForChild("leaderstats"):FindFirstChild((tostring(args[3]))) then
												local stat = plr:WaitForChild("leaderstats"):WaitForChild((tostring(args[3])))
												stat.Value = tonumber(args[4])
												return ("Changed player "..(player.Name).."'s "..(tostring(args[3])).." to "..(formatter.format(tonumber(args[4])))), (Color3.fromRGB(100, 150, 255))
											else
												return ("Stat "..(tostring(args[3])).." could not be found. Please refine your search."), (Color3.fromRGB(255, 100, 100))
											end
										end
									else
										if (string.lower((tostring(args[3])))) == "drinks" or (string.lower(tostring((args[3])))) == "minutes" or (string.lower((tostring(args[3])))) == "drink" or (string.lower((tostring(args[3])))) == "minute" then
											local plrUserId = plrs:GetUserIdFromNameAsync((tostring(args[2])))
											local plrUsername = plrs:GetNameFromUserIdAsync((tonumber(plrUserId)))
											if (string.lower((tostring(args[3])))) == "drinks" or (string.lower((tostring(args[3])))) == "drink" then
												DDS:SetAsync(plrUserId, tonumber(args[4]))
												return ("Changed player "..plrUsername.."'s "..(tostring(args[3])).." to "..(formatter.format(tonumber(args[4])))), (Color3.fromRGB(100, 150, 255))
											elseif (string.lower((tostring(args[3])))) == "minutes" or (string.lower((tostring(args[3])))) == "minute" then
												MDS:SetAsync(plrUserId, tonumber(args[4]))
												return ("Changed player "..plrUsername.."'s "..(tostring(args[3])).." to "..(formatter.format(tonumber(args[4])))), (Color3.fromRGB(100, 150, 255))
											end
										else
											return ("This stat isn't whitelisted for cross-server stat changing."), (Color3.fromRGB(255, 100, 100))
										end
									end
								else
									return ("Amount "..(tonumber(args[4])).." is not valid. Please enter a valid number."), (Color3.fromRGB(255, 100, 100))
								end
							else
								return ("Stat "..(tostring(args[3])).." could not be found. Please refine your search."), (Color3.fromRGB(255, 100, 100))
							end
						else
							return ("Player "..(tostring(args[2])).." can not be found throughout ROBLOX. Please refine your search."), (Color3.fromRGB(255, 100, 100))
						end
					end
				else
					return ("Your message being full of whitespaces is not allowed."), (Color3.fromRGB(255, 100, 100))
				end
			end
		end
	end)
	if not success then
		print(response)
	end
end