Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- I'll make an example admin script for you rn:
- Pass each phrase separated by spaces as its own argument, or in an array that I'll call "data", and depending on the prompting command, execute a different function from a table
- local prefix = "!" -- maybe that's your command prefix
- local adminIDs = {
- [12341234] = true,
- [12341234] = true,
- [12341234] = true,
- } -- your admins' userID here
- function GetWordsFromString(text)
- local tab = {}
- for w in string.gmatch(s, "%a+") do
- if string.sub(w,#w,#w) == " " then
- w = string.sub(w,1,#w-1) -- to remove that space at the end
- end
- tab[#tab+1] = w
- end
- return tab
- end
- local functionTable = {
- ["kill"] = function(sender,data)
- local targName = data[2]
- local targPlayer = game.Players:FindFirstChild(targName)
- local targChar = targ.Player.Character
- if targChar then
- targChar:BreakJoints()
- end
- ["msg"] = function(sender,data)
- local text = data[2]
- local message = Instance.new("Message",workspace)
- message.Text = sender.Name..": "..text
- game:GetService("Debris"):AddItem(message,(#message.Text*.075,+5))
- end
- function ReceiveCommand(player,data)
- local key = string.sub(data[1],-(#data[1]-1),#data[1])
- functionTable[key](player,data)
- end
- for _,player in next,game.Players:GetPlayers() do
- player.Chatted:connect(function(text)
- if adminIDs[player.UserId] and string.sub(data[1],1,1) == prefix then
- ReceiveCommand(player,data)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement