In short im trying to send over a value object to a local script from a server script. But i get this error: FireClient: player argument must be a Player object
Whats wrong?
local event = game.ReplicatedStorage.change
local numbers = script.Parent.TableVal
function leftClick()
local clone = game:GetService("ReplicatedStorage"):WaitForChild("Table"):Clone()
game.ReplicatedStorage:WaitForChild("Place"):WaitForChild("Chosen"):Destroy()
clone.Parent = game.ReplicatedStorage:WaitForChild("Place")
clone.Name = ("Chosen")
event:FireClient(numbers) --where it is erroring
end
script.Parent.MouseButton1Click:Connect(leftClick)
If for whatever reason you don’t have the player, just keep doing .Parent until you reach the player. Anything that handles a single player should have a method of retrieving them, too, but sometimes it’s unprepared.
You can’t use :FireClient() on a localscript, you can use bindableevents though for something like that, for more information about them look up “BindableEvent Roblox Devhub” on Google