So, how would I be able to do it?
Admins = {} script.Parent.Touched:connect(function(hit) if hit.Parent:findFirstChild("Humanoid") then --What now? :) end end)
Also, how would I check if the player that touched it is already in the table so there is no duplicate player entries?
Admins[hit.Parent.Name]=game.Players:GetPlayerFromCharacter(hit.Parent)
This will insert their name as a key into the table with their player as the value. There can't be duplicate keys in the same table.
This goes through the admin table and checks for their name. If it's already there, nothing happens. If not, then it inserts their name into the admin table. Untested so not sure if it works.
for i, v,in pairs(Admins) do if.hit.Parent.Name == i then print("already in table") elseif hit.Parent.Name == nil then table.insert(Admins, hit.Parent.Name) end end
Locked by JesseSong
This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.
Why was this question closed?