game.Players.PlayerAdded:Connect(function(player) local plylist = {game.Players:GetPlayers()} if plylist[2] == nil then if player.CharacterAdded then player.Character:WaitForChild("Head") local memez = Instance.new("ParticleEmitter") memez.Parent = player.Character.Head memez.Name = "Memez" end end end)
Can someone please explain to me what is going wrong in this script and how I can fix? (It is not a local script)
Rather than player.CharacterAdded try this method:
local Players = game:GetService('Players') Players.PlayerAdded:Connect(function(Player) local plyList = {Players:GetPlayers()} if plyList[2] == nil then -- it checks for character or waits for character local Character = Player.Character or Player.CharacterAdded:Wait() Character:WaitForChild('Head') local memez = Instance.new("ParticleEmitter") memez.Parent = Player.Character.Head memez.Name = "Memez" end -- plyList check end) -- playerAdded