This is the script for the remote event:

local RemoteEvent = game:GetService("ReplicatedStorage"):WaitForChild("RemoteEvent")

RemoteEvent.OnServerEvent:Connect(function(player,itemName)
	for _,item in pairs(game.ServerStorage:WaitForChild("Food")) do
		if item:IsA("Tool") and item.Name == itemName then
			item:Clone().Parent = player.Character
		end 
	end
end)

This is the localscript for the remote event:

local RemoteEvent = game:GetService("ReplicatedStorage"):WaitForChild("RemoteEvent")

RemoteEvent:FireServer("Mocha")

Have I made any mistakes? If so, please tell me as it could be vital to fix this situation.

3 comments

0

The problem is you didn't send the itemName parameter in your FireServer function. You never defined "itemName" either.

0

What exactly is "Food" in the ServerStorage?

0

Nevermind, I found my mistake, I just hadn't put a tool in 'Foods' haha silly me.