Xyaioh
|
  |
| Joined: 01 May 2013 |
| Total Posts: 662 |
|
|
| 11 May 2013 02:35 AM |
admins = {"Xyaioh", "Nobody"}
function check(player) for i,v in pairs("admins") do if player == #admins then return true else return false end end end |
|
|
| Report Abuse |
|
|
Xyaioh
|
  |
| Joined: 01 May 2013 |
| Total Posts: 662 |
|
|
| 11 May 2013 02:36 AM |
LOL. I am such a beginner scripter.
This is just what I guessed what I had to do.
admins = {"Xyaioh", "ff"}
function check(player) for i,v in pairs("admins") do if player == #admins then return true else return false end end end
function onButtonClicked() if check == true then game.Lighting.Map1:clone().Parent = game.Workspace else print("No permission") end end
script.Parent.MouseButton1Click:connect(onButtonClicked) |
|
|
| Report Abuse |
|
|
Voidion
|
  |
| Joined: 01 Aug 2011 |
| Total Posts: 2668 |
|
|
| 11 May 2013 02:40 AM |
| for i,v in pairs(admins) do |
|
|
| Report Abuse |
|
|
Xyaioh
|
  |
| Joined: 01 May 2013 |
| Total Posts: 662 |
|
|
| 11 May 2013 02:40 AM |
| Wait so did I do some of it right???? o.o |
|
|
| Report Abuse |
|
|
Voidion
|
  |
| Joined: 01 Aug 2011 |
| Total Posts: 2668 |
|
|
| 11 May 2013 02:41 AM |
| Everything but that one line. :) |
|
|
| Report Abuse |
|
|
Xyaioh
|
  |
| Joined: 01 May 2013 |
| Total Posts: 662 |
|
|
| 11 May 2013 02:42 AM |
I just patted myself on the back.
I totally just guessed what it would be. Wow.
I'm happy now xD |
|
|
| Report Abuse |
|
|
Xyaioh
|
  |
| Joined: 01 May 2013 |
| Total Posts: 662 |
|
|
| 11 May 2013 02:45 AM |
admins = {"Xyaioh", "Player", "Player1"}
function check(player) for i,v in pairs(admins) do if player == #admins then return true else return false end end end
function onButtonClicked() if check() == true then print("Is an Admin") else print("No permission") end end
script.Parent.MouseButton1Click:connect(onButtonClicked)
That is the current script for testing, and the output keeps posting
No permission.
Halp? |
|
|
| Report Abuse |
|
|
Voidion
|
  |
| Joined: 01 Aug 2011 |
| Total Posts: 2668 |
|
|
| 11 May 2013 03:02 AM |
Try this:
admins = {"Xyaioh", "Player", "Player1"}
function check(name) for i = 1,#admins do if (string.upper(name) == string.upper(admins[i])) then return true end end return false end
function onButtonClicked(player) if (check(player.Name)) then print("Is an Admin") else print("No permission") end
end script.Parent.MouseButton1Click:connect(onButtonClicked) |
|
|
| Report Abuse |
|
|
Xyaioh
|
  |
| Joined: 01 May 2013 |
| Total Posts: 662 |
|
|
| 11 May 2013 03:06 AM |
Thanks!
Even though while you were fixing my terrible noobish mistakes I was trying a new script...
player = script.Parent.Parent.Parent admins = {"Xyaioh","Player", "Player1"} isAdmin = false
function showIsAdminMessage(player) local message = Instance.new("Message") message.Parent = player.PlayerGui message.Text = " Permission Granted To ".. player.Name ". You have access to Training Maps." wait(5) failmessage:remove() end
function showIsntAdmin(player) local failmessage = Instance.new("Message") failmessage.Parent = player.PlayerGui failmessage.Text = " Permission Not Granted To ".. player.Name "." wait(5) failmessage:remove() end
for i = 1, #admins do if player.Name == admins[i] then isAdmin = true showIsAdminMessage() else showIsntAdmin() break end end
if not isAdmin then script.Parent:remove() wait(0.5)
end
|
|
|
| Report Abuse |
|
|
Voidion
|
  |
| Joined: 01 Aug 2011 |
| Total Posts: 2668 |
|
| |
|
Xyaioh
|
  |
| Joined: 01 May 2013 |
| Total Posts: 662 |
|
| |
|