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

Why does my script say "table: 0xaaaf0a511f845103", when I try to put my username into a table?

Here is my code:

game.Workspace.School.DuelingDoor.DoorPart.Touched:Connect(function(hit) --Touched door to enter dueling 
	if duelingLocked then
		print("Class Locked!")
	else
		local humanoidRootPart = game.Workspace:WaitForChild(hit.Parent.Name):WaitForChild("HumanoidRootPart")
		humanoidRootPart.CFrame = CFrame.new(game.Workspace.School.Dueling.DuelSpawn.Position + Vector3.new(0,3,0))
		table.insert(playersInClass, #playersInClass+1,hit.Parent.Name)
		print(playersInClass)
	end
end)

(This is running on the server) This code is just for testing. I hope somebody can tell me, why it doesn't work. :( - Toby

1 answer

✓ Accepted answer

what you are printing is the table itself, not what you added inside, if you want to print what you added simply index the child, like you added it.

        table.insert(playersInClass, #playersInClass+1,hit.Parent.Name)
        print(playersInClass[#playersInClass])

1 comment

0

Woah.... Let me just see, if this works.

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