XoDust
|
  |
| Joined: 23 Apr 2012 |
| Total Posts: 1401 |
|
|
| 16 Apr 2013 10:32 PM |
admins = {"Xodust","Offensively"}
function isAdmin(name) for i,v in pairs(admins) do if name:lower() == v:lower() then return true end end return false end
function onChatted(msg, recipient, speaker)
local source = string.lower(speaker.Name) msg = string.lower(msg)
if (msg == "Attack!" or "Banzai!") then Game.Lighting.Part.Parent = Workspace
end
end
function onPlayerEntered(newPlayer) newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, newPlayer) end) end
game.Players.ChildAdded:connect(onPlayerEntered)
Everything after
admins = {"Xodust","Offensively"}
function isAdmin(name) for i,v in pairs(admins) do if name:lower() == v:lower() then return true end end return false end
works but I don't know how to make the permission levels to only certain people
Please help |
|
|
| Report Abuse |
|
|
ball360
|
  |
| Joined: 31 Mar 2009 |
| Total Posts: 1557 |
|
|
| 16 Apr 2013 10:36 PM |
What do you mean by permissions?
|
|
|
| Report Abuse |
|
|
XoDust
|
  |
| Joined: 23 Apr 2012 |
| Total Posts: 1401 |
|
|
| 16 Apr 2013 10:36 PM |
Sort of like admin commands
where only admins/people on a list can speak the command |
|
|
| Report Abuse |
|
|
XoDust
|
  |
| Joined: 23 Apr 2012 |
| Total Posts: 1401 |
|
| |
|
|
| 16 Apr 2013 10:58 PM |
You never called the isAdmin function, assuming it works.
(╯°□°)> KMXD |
|
|
| Report Abuse |
|
|
XoDust
|
  |
| Joined: 23 Apr 2012 |
| Total Posts: 1401 |
|
| |
|
XoDust
|
  |
| Joined: 23 Apr 2012 |
| Total Posts: 1401 |
|
| |
|
adark
|
  |
| Joined: 13 Jan 2008 |
| Total Posts: 6412 |
|
|
| 17 Apr 2013 12:48 AM |
admins = {"Xodust","Offensively"}
function isAdmin(name) for i,v in pairs(admins) do if name:lower() == v:lower() then return true end end return false end
function onChatted(msg, recipient, speaker) if not IsAdmin(speaker) then return end --This will exit the function without executing any of the following code, so that only Players in the admin list can use the commands.
local source = string.lower(speaker.Name) msg = string.lower(msg)
if (msg == "attack!" or "banzai!") then --Make sure you only use lowercase letters. Game.Lighting.Part.Parent = Workspace
end
end
function onPlayerEntered(newPlayer) newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, newPlayer) end) end
game.Players.ChildAdded:connect(onPlayerEntered)
|
|
|
| Report Abuse |
|
|
yi18
|
  |
| Joined: 30 Aug 2010 |
| Total Posts: 11443 |
|
| |
|
XoDust
|
  |
| Joined: 23 Apr 2012 |
| Total Posts: 1401 |
|
| |
|