local Admins = {"andrewplayer", "SarnikZorion1", "xBlitzIV", "JoJoParkerx"}
local command = "/r"
function TeleportPlayer(Torso)
if not Torso then return end
if Torso then
Torso.CFrame = CFrame.new(script.Parent.CFrame * CFrame.new(0, 5, 0))
end
end
function Check(playerName)
for i = 1, #Admins do
if string.upper(Admins[i]) == playerName then
return true
end
end
end
game.Players.PlayerAdded:Connect(function(player)
local source = string.upper(player.Name)
Check(source)
if Check() == true then
player.Chatted:Connect(function(msg)
print(msg)
end)
end
end)
COMMUNITY QUESTION
Why wont the chatted event work? Its not even printing msg? (Thank you if you reply)
0 answers
No public answers were preserved for this question.
This discussion is preserved as it was. New answers, comments, and votes are closed.

6 comments
Nothing is working because you aren't connecting your functions, lets say
function TeleportPlayer(Torso). You have to define what the function is, like what you did on line 22.and your print on line 27 isnt in " "
I tried that, but it still isnt working
You aren't using your functions correctly. It should be if Check(source) == true then, because doing Check() doesn't do anything as you're not filling in your parameter, and doing Check(source) is just returning true, and you're not checking anything.
You don't need line 24, you need to change line 25 to if Check(source) == true then
It worked, i changed it to check(source) in the if statement, thank you!