So, I'm quite new to making tables and I am not quite sure how they work yet, so I have been doing some experimenting. I made a script using tables to try it out, but I don't know what's wrong and why it's wrong.
Code:
local invis = { --table ["BlackKnightXx"] = true, ["InfinitySoldier"] = true } game.Players.PlayerAdded:connect(function(player) --player joins wait(5) --wait for character if player.Name == invis then --if player is on the invis table local char = player.Character --fetching character char.Head.Transparency = 1 --invisible head end end)
local invis = { --table ["BlackKnightXx"] = true, ["InfinitySoldier"] = true } game.Players.PlayerAdded:connect(function(player) --player joins wait(5) --wait for character if invis[player.Name] then --if the Player is in the invis table. local char = player.Character --fetching character char.Head.Transparency = 1 --invisible head end end)
You index a table using []. Indexes can be numerical, string, or any other data type.