Okay, so I am making an admin script and have run into a problem;
It prints the error message if a player tried to use a command without even using the prefix. And even does it if they are admin. But it does still do it correct if they use the prefix.
Here is my code;
local Admins = {["mosski123"] = true, ["Player1"] = true}
local prefix = ';'
function onChatted(message, player)
if message == prefix.."reset" and Admins[player.Name] then
player.Character:BreakJoints()
else
print("[LINC] "..player.Name.. " tried to use the 'reset command!'")
end
if message == prefix.."rejoin" and Admins[player.Name] then
game:GetService("TeleportService"):Teleport(game.PlaceId, player)
if player.Character ~= nil then
player.Character:remove()
end
end
end
game.Players.PlayerAdded:connect(function(player)
player.Chatted:connect(function(message) onChatted(message, player) end)
end)

3 comments
I will implement this into my game now, and if it works, I'll upvote and accept, if not I'll let you know.
I'm sorta confused on how to implement it.
Which part?