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)

6 comments

0

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.

0

and your print on line 27 isnt in " "

0

I tried that, but it still isnt working

0

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.

0

You don't need line 24, you need to change line 25 to if Check(source) == true then

0

It worked, i changed it to check(source) in the if statement, thank you!