my goal is to find player name in the moderator table and then if he is staff then if the message is… then it will teleport to the second player. i don’t know why my table not work(no errors)
local moderator = {"artum669","straff"}
local Players = {}
game.Players.PlayerAdded:Connect(function(player)
for i,v in pairs(game.Players:GetPlayers()) do
table.insert(Players,v)
end
local staff = table.find(moderator,player.Name)
local OtherPlayer = table.find(Players,player)
print(staff)
player.Chatted:Connect(function(message)
if player.Name == staff then
print("staff")
if message == "/tp "..OtherPlayer then
staff.Character.HumanoidRootPart.CFrame = CFrame.new(OtherPlayer.Character.HumanoidRootPart.CFrame)
end
else
print("not staff")
end
end)
end)
the output of the print(staff) is = 1