So what I mean by this is I need to try send an item in Workspace as a variable and fire it to the client. The client is mean to pick this is up and set it as a local, but however this is not the case. It returns in the client as 'nil'.
--Server Script: --I do have a local for the Player local item = game.Workspace.Item local event = game.ReplicatedStorage.ReVent ReVent:FireClient(Player, item) print(item) -- this works
The script is in ServerScriptService by the way.
--Client Local Script (PlayerGui) ReVent.OnClientEvent:Connect(function(Player, item) print(item) -- prints nil end)
Any help?
For OnClientEvent, the first parameter isn't the player firing the client - that's for OnServerEvent
ReVent.OnClientEvent:Connect(function(item) print(item) end)
OnClientEvent doesn't receive a Player parameter.
--Client Local Script (PlayerGui) ReVent.OnClientEvent:Connect(function(item) -- removed 'Player' print(item) -- prints nil end)