generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Admin Find Name.

Previous Thread :: Next Thread 
Ezcema is not online. Ezcema
Joined: 18 Jul 2013
Total Posts: 6
05 Dec 2013 03:06 PM
I'm making an admin script for a friend, and I am stuck on the find player bit. I'm not sure how to do it.
I'd like it like it is in Kohltastrophe's admin. You can say ':jail Ez', and it'll still jail me.

I am unsure of how to find a little of someones name (e.g. ':jail Ez' would Jail me.) Also, this doesn't seem to work. Any help?
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
I currently have:

admins = {"Ezcema","AnotherName"}
bannedPlayers = {"ContentAddicted"}


game.Players.PlayerAdded:connect(function(player)
for i,v in pairs(bannedPlayers) do --Check for banned player.
if string.match(string.lower(c), string.lower(player.Name)) then
foundBannedPlayer = true
end
end
if foundBannedPlayer == true then
player:Kick()
elseif foundBannedPlayer ~= true then
player.Chatted:connect(function(message)
onChatted(message,player)
end)
end
end)

function findPlayer(name)
for i,v in pairs(game.Players:GetChildren()) do
if v.Name:lower() == name:lower() then
return v
end
end
end

function onChatted(msg, player)
if msg:sub(1,5) == "kill-" and admins[plr.Name] then
Thevictim = findPlayer(msg:sub(6))
if Thevictim then
Thevictim.Character:BreakJoints()
end
end
end
Report Abuse
Ezcema is not online. Ezcema
Joined: 18 Jul 2013
Total Posts: 6
05 Dec 2013 03:13 PM
I've changed a few things, but still doesn't work.

admins = {"Ezcema","AnotherName"}
bannedPlayers = {"ContentAddicted"}


game.Players.PlayerAdded:connect(function(player)
for i,v in pairs(bannedPlayers) do --Check for banned player.
if string.match(string.lower(c), string.lower(player.Name)) then
foundBannedPlayer = true
end
end
if foundBannedPlayer == true then
player:Kick()
elseif foundBannedPlayer ~= true then
player.Chatted:connect(function(message)
onChatted(message,player)
end)
end
end)

function findPlayer(name)
for i,v in pairs(game.Players:GetChildren()) do
if v.Name:lower() == name:lower() then
return v
end
end
end

function onChatted(msg, player)
if msg:sub(1,5) == "kill-" then
Thevictim = findPlayer(msg:sub(6))
if Thevictim then
Thevictim.Character:BreakJoints()
end
end
if msg:sub(1,10) == "time-night" then
game.Lighting.TimeOfDay = "00:00:00"
end
if msg:sub(1,8) == "time-day" then
game.Lighting.TimeOfDay = "12:00:00"
end

end
Report Abuse
Ezcema is not online. Ezcema
Joined: 18 Jul 2013
Total Posts: 6
05 Dec 2013 03:40 PM
BUMPer cars.
Report Abuse
DrRandomous is not online. DrRandomous
Joined: 25 Mar 2011
Total Posts: 1702
05 Dec 2013 04:26 PM
I wanna know about this too. Curious
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image