Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 5 years ago
Edited 5 years ago

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

Log in to vote
2
Answered by
Elixcore 1337 Moderation Voter
5 years ago

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])
0
Woah.... Let me just see, if this works. tobiO0310 58 — 5y
Ad

Answer this question