Remote function running at start, then erroring

-- client script
local player =                  game.Players.LocalPlayer
local ScreenGui =               player.PlayerGui:WaitForChild("ScreenGui")
local AttemptClaimEXPItem = 	game.ReplicatedStorage.AttemptClaimEXPitem
local BoxPass = 				ScreenGui.Stackable.Opened.BoxPass
local EXPRoadItems = 			BoxPass.Contents.ScrollingFrame.ItemsFrame:GetChildren()

for i,v in pairs(EXPRoadItems) do
	if not v:IsA("Frame") then
		EXPRoadItems[i] = nil
	end
end



local function Attempt_Claim_ExpItem(bracketnumber,PassOrNot)
	print("Client attempting to claim item")
	local result = AttemptClaimEXPItem:InvokeServer(bracketnumber,PassOrNot)
	if result == "Success" then	
	end
	if result == "Failed" then
	end
end

for i,v in pairs(EXPRoadItems) do
	local number = tonumber(v.Name)
	v.RegularItem.ClaimButton.Activated:Connect(function()
		Attempt_Claim_ExpItem(number,"Regular")
	end)
	v.BattlePassitem.ClaimButton.Activated:Connect(function()
		Attempt_Claim_ExpItem(number,"BattlePass")
	end)
end


-- server script

local function Attempt_Claim_EXP_Item(player,bracketnumber,PassorNot)
	print("Got here")
	local result = "Success"

	--first, check if what they sent was even legitimate
	local legit = true
	
	if PassorNot ~= "Regular" and PassorNot ~= "BattlePass" then
		legit = false
	end
	print(typeof(bracketnumber))
	
	--
	
	return result
end
AttemptClaimEXPitem.OnServerInvoke = Attempt_Claim_EXP_Item()

it prints “Got here” and nil as soon as the server starts, then, when I try to press one of the claim buttons in game on the client, it prints the “client attempting to claim item” statement, but then errors: “Attempt to call string value” from the server first, an then errors the same thing from the client. I don’t know what I’m doing wrong.

Figured it out. It was because I added () to this line

AttemptClaimEXPitem.OnServerInvoke = Attempt_Claim_EXP_Item

it ran the function, turned into a string since that’s what the function returned, then, when the client tried to run it, it was trying to run a string, and thus errored. Simple mistake.