earlier I asked a question about admin commands and someone told me to look at a wiki article and come back if I had questions. I have a question about a command i want to make and here is what I tried to do:
local isAdmin = {["OceanFizFiz"] = true,}
function findPlayer(name)
for _, player in ipairs(game.Players:GetPlayers()) do
if player.Name:lower() == name:lower() then
return player
end
end
end
function onChatted(message, player)
if message:sub(1, 5) == "kill/" and isAdmin[player.Name] then
victim = findPlayer(message:sub(6))
if victim and victim.Character then
victim.Character:BreakJoints()
end
end
if message:sub(1,5) = "stop/" and isAdmin[player.Name] then
victim = findPlayer(message:sub(6)
if victim and victim.Character then
local parts = victim.Character:GetChildren()
for i = 1,#parts do
parts[i].Anchored = true
end
end
end
end
game.Players.PlayerAdded:connect(function(player)
player.Chatted:connect(function(message) onChatted(message, player) end)
end)
i wanted to make a command that stops a player so they can’t move. I think the anchor part of things would do that but it didn’t work for me. Can someone tell me why it didn’t work please?

1 comment
uggh, i keep making some stupid mistakes. thank you!