Trying to make an admin. Have I made a mistake? Is it in the wrong place? (StarterGui)
local List = {["Player1"] = true, ["Player1"] = true } -- allowed admins local Prefix = "/" -- kill/Player1 Target = nil function FindPlayer(userName) for _, Player in ipairs (game.Player:GetPlayers()) do if string.lower(Player.Name) == string.lower(userName) then return Player end end end game.Players.PlayerAdded:connect(fucntion(userJoined) userJoined.Chatted:connect(function(Message) Message = string.lower(Message) if Message:sub(1,5) == "kill"..Prefix and List[userJoined.Name] then // kill/me if Message:sub(6) == "me" then Target = userJoined else Target = FindPlayer(Message:sub(6)) end if Target and Target.Character then Target.Character:BreakJoints() end end end) end)
Yes, it is in the completely wrong place. StaterGUI is for Gui's (Text and stuff that appears on your screen).
Put this in ServerScriptService, and if not a;ready in a normal script, do that.
BTW, at the top in variable "list", your supposed to change those player names to who you want to be admins.
This script should be located inside ServerScriptService instead otherwise it would not run properly.