I'm trying a clone a hat onto a player's character from ReplicatedStorage but it says Argument 1 missing or nil. I'm new to RemoveEvents and RemoteFunctions so I need a little bit of help.
LocalScript in a TextButton It says Argument 1 is missing or nil on the InvokeServer() part.
script.Parent.MouseButton1Down:connect(function()
local hat = game.ReplicatedStorage.CoolBoyHair:Clone()
workspace.Remote.GarrickHat:InvokeServer(hat)
end)
Script in ServerScriptService
local GarrickHat = workspace.Remote.GarrickHat
function GarrickHat.OnServerInvoke(player, hat)
local g = game.ReplicatedStorage:FindFirstChild(hat)
if hat then
hat:Clone().Parent = player.Character
end
end

2 comments
Thanks so much, it worked!
No problem