So, my script is finding out which flavour has been clicked on a GUI and then send the name of that flavour to the server. I have the function in the LocalScript and I'm trying to send it to the script, but I can't seem the figure out how. Here is my code that I have tried but hasn't seem to work. (I'm new to using RemoteFunctions).
Code:
--Local Script
local crispFlavour = game.ReplicatedStorage.crispFlavour
local frame = script.Parent
local tool = game.ReplicatedStorage.Crisps
local function getFlavour(player, flavour)
for i,v in pairs(frame:GetChildren()) do
game.Workspace.Bowl.ClickDetector.MouseClick:Connect(function(player)
v.MouseButton1Click:Connect(function()
local flavour = v
for i,v in pairs(tool:GetChildren()) do
if v.Name == flavour.Name then
crispFlavour:FireServer(flavour)
end
end
end)
end)
end
end
--Server Script
local crispFlavour = game.ReplicatedStorage.crispFlavour
local newPart = crispFlavour:InvokeServer(flavour)
print(flavour)
--I'm pretty sure this is where the problem is.
Any help would be much appreciated, thank you.

3 comments
Aight, got it.
Also, needs to be InvokeServer() not FireServer
If you're using a remote event it is fireServer() and .OnServerEvent:Connect(printFlavour) instead of what I have on line 5