So I am experimenting around on a shop system, and I am using a sample int value to see how remote functions basically work. This is what I got so far:
Local Script:
local remoteFunction = game.ReplicatedStorage.ShopFunction
script.Parent.MouseButton1Click:Connect(function()
remoteFunction:InvokeServer()
end)
remoteFunction.OnClientInvoke = function(cash)
print(cash)
end
Server Script
local remoteFunction = game.ReplicatedStorage.ShopFunction
remoteFunction.OnServerInvoke = function()
remoteFunction:InvokeClient(game.Players.LocalPlayer, game.ServerStorage.Cash.Value)
end
I am getting thrown the following error:
11:36:32.575 Argument 1 missing or nil - Client - LocalScript:3
Any help would be appreciated! I am unsure where I’m wrong.