Poomuffin
|
  |
| Joined: 13 Mar 2010 |
| Total Posts: 11369 |
|
|
| 08 Oct 2013 12:15 AM |
supposed to give playernamehere a certain badge when poomuffin chats :boost playernamehere
local BADGEID = 0000000 function getPlayer(player) local returned = {} for i,v in pairs(game.Players:GetPlayers()) if v.Name:sub(1,player:len()):lower() == player:lower() then table.insert(returned,v) end end return returned end game.Players.PlayerAdded:connect(function(plr) if plr.Name:lower() == "poomuffin" then plr.Chatted:connect(function(msg) if msg:lower():sub(1,7) == ":boost" then playr = getPlayer(msg:sub(8)) if #playr == 1 then local plyr = player[1] if plyr then game:GetService("BadgeService"):AwardBadge(plyr.userId, BADGEID) end end end end) end end) |
|
|
| Report Abuse |
|
|
Poomuffin
|
  |
| Joined: 13 Mar 2010 |
| Total Posts: 11369 |
|
| |
|
noah
|
  |
| Joined: 11 Sep 2006 |
| Total Posts: 18977 |
|
|
| 08 Oct 2013 12:23 AM |
local BADGEID = 0000000
game.Players.PlayerAdded:connect(function(plr) if plr.Name:lower() == "poomuffin" then plr.Chatted:connect(function(msg)
if string.sub(msg, 1,7) == ":boost " then for i,v in pairs (game.Players:GetChildren()) do if string.find(string.lower(v.Name),string.lower(string.sub(msg,8))) == 1 then if game:GetService("BadgeService"):UserHasBadge(v.userId, BADGEID) == false then print("error") else game:GetService("BadgeService"):AwardBadge(v.userId, BADGEID) end end end end
end) end end) |
|
|
| Report Abuse |
|
|
noah
|
  |
| Joined: 11 Sep 2006 |
| Total Posts: 18977 |
|
|
| 08 Oct 2013 12:45 AM |
local BADGEID = 0000000
game.Players.PlayerAdded:connect(function(plr) if plr.Name == "Poomuffin" then plr.Chatted:connect(function(msg)
if string.sub(msg, 1,7) == ":boost " then for i,v in pairs (game.Players:GetChildren()) do if string.find(string.lower(v.Name),string.lower(string.sub(msg,8))) == 1 then if game:GetService("BadgeService"):UserHasBadge(v.userId, BADGEID) == false then print("error") else game:GetService("BadgeService"):AwardBadge(v.userId, BADGEID) end end end end
end) end end) |
|
|
| Report Abuse |
|
|