Spectrumz
|
  |
| Joined: 22 Mar 2011 |
| Total Posts: 4338 |
|
|
| 12 Aug 2011 03:54 PM |
local moderators = {"Controllers", "robotman5114", "88dragon6", "IMstDie87", "Spectrumz"}
local admins = {"CaptainAndy", "nicholasjonasfan", "mydarkrai246", "CPTAndy", "Rabbit108227", "Spectrumz"}
function verifyMods(name) for i, v in pairs(moderators) do if string.lower(name) == string.lower(v) then return true else return false end end end
function verifyAdmins(name) for i, v in pairs(admins) do if string.lower(name) == string.lower(v) then return true else return false end end end
script.Parent.MouseButton1Down:connect(function() local tbFinder = script.Parent.Parent:findFirstChild("M&ACP - Moderator and Administrator Control Panel") local tb2Finder = script.Parent.Parent:findFirstChild("ACP - Administrator Control Panel") if tbFinder and tb2Finder then return end if verifyMods(game.Players.LocalPlayer.Name) or verifyAdmins(game.Players.LocalPlayer.Name) then --One line |
|
|
| Report Abuse |
|
|
Spectrumz
|
  |
| Joined: 22 Mar 2011 |
| Total Posts: 4338 |
|
|
| 12 Aug 2011 03:55 PM |
| Sorry! The mistake should be at the end if statement. I forgot about the sticky. |
|
|
| Report Abuse |
|
|
Spectrumz
|
  |
| Joined: 22 Mar 2011 |
| Total Posts: 4338 |
|
| |
|
Spectrumz
|
  |
| Joined: 22 Mar 2011 |
| Total Posts: 4338 |
|
|
| 12 Aug 2011 07:55 PM |
| I know you're looking at this thread, AFF. |
|
|
| Report Abuse |
|
|
Bannana97
|
  |
| Joined: 22 Jun 2008 |
| Total Posts: 10215 |
|
| |
|
Spectrumz
|
  |
| Joined: 22 Mar 2011 |
| Total Posts: 4338 |
|
| |
|
|
| 12 Aug 2011 10:21 PM |
| No clue, but thanks for posting this. I just realized for my script I needed to do string.lower() on the table when it checks the players. :L |
|
|
| Report Abuse |
|
|
|
| 12 Aug 2011 10:22 PM |
| o.o Nevermind, my doens't use string.lower when they check the player. >.> Any output for this? |
|
|
| Report Abuse |
|
|
Spectrumz
|
  |
| Joined: 22 Mar 2011 |
| Total Posts: 4338 |
|
|
| 13 Aug 2011 12:28 PM |
| No, since it's in the StarterGui which is then cloned into the PlayerGui. |
|
|
| Report Abuse |
|
|
Bannana97
|
  |
| Joined: 22 Jun 2008 |
| Total Posts: 10215 |
|
| |
|
Spectrumz
|
  |
| Joined: 22 Mar 2011 |
| Total Posts: 4338 |
|
| |
|
Spectrumz
|
  |
| Joined: 22 Mar 2011 |
| Total Posts: 4338 |
|
|
| 13 Aug 2011 12:36 PM |
| What I want this script to do is check to see if the person who clicked the GUI is in either one of the tables. |
|
|
| Report Abuse |
|
|
Bannana97
|
  |
| Joined: 22 Jun 2008 |
| Total Posts: 10215 |
|
| |
|
Spectrumz
|
  |
| Joined: 22 Mar 2011 |
| Total Posts: 4338 |
|
|
| 13 Aug 2011 12:40 PM |
...The rest of it is just editing two cloned GUIs.
And just so you know, this script worked BEFORE I had the admin/moderator table with that added if statement (yes, I added another end for it). Plus, the rest of the script is EXTREMELY long. |
|
|
| Report Abuse |
|
|
Bannana97
|
  |
| Joined: 22 Jun 2008 |
| Total Posts: 10215 |
|
| |
|
Spectrumz
|
  |
| Joined: 22 Mar 2011 |
| Total Posts: 4338 |
|
|
| 13 Aug 2011 12:53 PM |
Yes. I want the script to run ONLY if they don't exist, which they don't. (They only exist in Lighting, where I don't check for them.) And I've done some experimenting...
local moderators = {"Controllers", "robotman5114", "88dragon6", "IMstDie87", "Spectrumz"}
local admins = {"CaptainAndy", "nicholasjonasfan", "mydarkrai246", "CPTAndy", "Rabbit108227", "Spectrumz"}
function verifyMods(name) for i, v in pairs(moderators) do if string.lower(name) == string.lower(v) then return true else return false end end end
function verifyAdmins(name) for i, v in pairs(admins) do if string.lower(name) == string.lower(v) then return true else return false end end end
game.Players.PlayerAdded:connect(function(p) p.CharacterAdded:connect(function(c) repeat wait() until c if verifyMods(p.Name) or verifyAdmins(p.Name) then local m = Instance.new("Message", p.PayerGui) m.Text = "You are an admin/moderator." wait(3) m:Remove() elseif verifyMods(p.Name) == false and verifyAdmins(p.Name) == false then local m = Instance.new("Message", p.PlayerGui) m.Text = "You are not admin/moderator." wait(3) m:Remove() end end) end)
That script makes a message on my screen telling me I'm NOT an admin, so obviously it's somewhere in the verification function or the checking part. |
|
|
| Report Abuse |
|
|
Bannana97
|
  |
| Joined: 22 Jun 2008 |
| Total Posts: 10215 |
|
| |
|