Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Stack Overflow
- sign up log in
- By using our site, you acknowledge that you have read and understand our Cookie Policy, Privacy Policy, and our Terms of Service.
- Questions
- Jobs
- Tags
- Users
- Badges
- Ask
- up vote-1down votefavorite
- Roblox Admin Command Script
- lua roblox
- I'm currently trying to make a new admin command script; all I have so far is the kill command... everything I've tried (so far) works unless I use the ":* me" parameter ("*"being any command and ":" being the recognition character. I don't quite understand why this doesn't work.
- I've tried a few crazy things to try to make this work, so the code may be butchered from what I had it as originally...
- admins = {"FakeNameHereSoNoStalkers"} function kill(target) for i=1,#target do game.Players.target[i].Character:BreakJoints() end end function isadmin(source) for i=1,#admins do if admins[i]:lower()==source:lower() then return true end end end function findplayer(msg, source) people = {} c = game.Players:GetChildren() if msg:lower()=="me" then table.insert(people, source) return people elseif msg:lower()=="all" then for i=1,#c do table.insert(people, c[i]) end return people else local length = msg:len() for i=1,#c do if c[i].Name:lower():sub(1, length)==msg:lower() then table.insert(people, c[i]) end end return people end end game.Players.PlayerAdded:connect(function(player) source = player.Name if isadmin(source) == true then player.Chatted:connect(function(msg, player) if msg:lower():sub(1,6)==":kill " then msg = msg:sub(7) target = findplayer(msg, source) kill(target) end end) end end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement