I just got this error and I checked if their are typos and their are none, I don't know what I did wrong. I need help, thanks.
local owner = {"TheCryptic_Dude"}
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
for i = 1, #player do
if owner[i] == player.Name then
local trail = game.ServerStorage.Trail:Clone()
trail.Parent = char.Head
local attachment0 = Instance.new("Attachment",char.Head)
attachment0.Name = "TrailAttachment0"
local attachment1 = Instance.new("Attachment",char.HumanoidRootPart)
attachment1.Name = "TrailAttachment1"
trail.Attachment0 = attachment0
trail.Attachment1 = attachment1
end
end
end)
end)

3 comments
Isn't Line 5 supposed to be "for i = 1, #owner do"?
The Player parameter is referring to the Player Object of the newly connected Client~~
Adding onto what Ziff said, player is an object, NOT a table, you cant iterate it.