I want to do something to each player when they join that’s only locally visible, so for testing I just print the names. But it prints nil each time.
ServerScript: (in ServerScriptService)
local Players = game:GetService(“Players”)
local ReplicatedStorage = game:GetService(“ReplicatedStorage”)
Players.PlayerAdded:Connect(function(player)
ReplicatedStorage.onSpawn:FireClient(player)
end)
LocalScript: (in StarterCharacterScripts)
local Teams = game:GetService(“Teams”)
local ReplicatedStorage = game:GetService(“ReplicatedStorage”)
local Players = game:GetService(“Players”)
ReplicatedStorage.onSpawn.OnClientEvent:Connect(function(player)
print(player)
end)
(the onSpawn RemoteEvent is in the ReplicatedStorage)