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
|
  |
| 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
|
  |
| Joined: 18 Jul 2013 |
| Total Posts: 6 |
|
| |
|
|
| 05 Dec 2013 04:26 PM |
| I wanna know about this too. Curious |
|
|
| Report Abuse |
|
|