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
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])