Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Attempt to get length of a Instance value?

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

0

Isn't Line 5 supposed to be "for i = 1, #owner do"?

0

The Player parameter is referring to the Player Object of the newly connected Client~~

0

Adding onto what Ziff said, player is an object, NOT a table, you cant iterate it.

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.