Surgo
|
  |
| Joined: 11 Jan 2011 |
| Total Posts: 2748 |
|
|
| 21 Jul 2014 08:21 PM |
local admins = script:WaitForChild("Admins").Value
function isAdmin(name) for i,v in pairs(admins) do if name:lower() == v:lower() then c = script.AdminGui:Clone() c.Parent = newPlayer.PlayerGui end end end
|
|
|
| Report Abuse |
|
|
UncleTaz
|
  |
| Joined: 19 Aug 2009 |
| Total Posts: 12795 |
|
|
| 21 Jul 2014 08:22 PM |
| What do you want to happen? |
|
|
| Report Abuse |
|
|
Surgo
|
  |
| Joined: 11 Jan 2011 |
| Total Posts: 2748 |
|
|
| 21 Jul 2014 08:26 PM |
Admins is a String Value, and obviously its filled with name.
When you join the server and you're an "Admin", then it'll clone "AdminGui" into PlayerGui. |
|
|
| Report Abuse |
|
|
Xephyric
|
  |
| Joined: 26 Mar 2009 |
| Total Posts: 2270 |
|
|
| 21 Jul 2014 08:26 PM |
WaitForChild is unreliable and often does not work. Instad do while not script:findFirstChild("Admins") do script.ChildAdded:wait() end local admins = script.Admins.Value
from here on I'm not sure what you're doing, because you are trying to iterate through a value.
|
|
|
| Report Abuse |
|
|
smiley599
|
  |
| Joined: 23 Jan 2010 |
| Total Posts: 21869 |
|
|
| 21 Jul 2014 08:29 PM |
| well value isnt a table so it wont work |
|
|
| Report Abuse |
|
|
Xephyric
|
  |
| Joined: 26 Mar 2009 |
| Total Posts: 2270 |
|
|
| 21 Jul 2014 08:29 PM |
Your stringvalue holds A string. Hence one thing. doing for i,v in pairs(admins) will not work because you cannot iterate through a string. Instead bring the list into the script
your list may be "you,me,pineapples" while
this table has three strings admins = {"you","me","pineapples"}
for i,v in pairs(admins) do end |
|
|
| Report Abuse |
|
|
UncleTaz
|
  |
| Joined: 19 Aug 2009 |
| Total Posts: 12795 |
|
|
| 21 Jul 2014 08:30 PM |
Admins = {["Name"] = true}
game:GetService("Players").PlayerAdded:connect(function(Player() if admins[Player.Name] then c = script.AdminGui:clone() c.Parent = Player:WaitForChild("PlayerGui") end end) |
|
|
| Report Abuse |
|
|
UncleTaz
|
  |
| Joined: 19 Aug 2009 |
| Total Posts: 12795 |
|
| |
|
Surgo
|
  |
| Joined: 11 Jan 2011 |
| Total Posts: 2748 |
|
|
| 21 Jul 2014 08:37 PM |
| How do I add multiple players to the list? |
|
|
| Report Abuse |
|
|
smiley599
|
  |
| Joined: 23 Jan 2010 |
| Total Posts: 21869 |
|
|
| 21 Jul 2014 08:38 PM |
| Admins = {["Name"] = true,["smile599"]=true} |
|
|
| Report Abuse |
|
|
Xephyric
|
  |
| Joined: 26 Mar 2009 |
| Total Posts: 2270 |
|
|
| 21 Jul 2014 08:46 PM |
Also you don't have anything triggering your function for when the player joins the game
game.Players.PlayerAdded:connect(isAdmin) |
|
|
| Report Abuse |
|
|
UncleTaz
|
  |
| Joined: 19 Aug 2009 |
| Total Posts: 12795 |
|
|
| 21 Jul 2014 08:49 PM |
@Xephyric
Uh no lol
My script works fine.
Test it if you like.
replace his code thread with
print ' Oh look an admin ' |
|
|
| Report Abuse |
|
|
UncleTaz
|
  |
| Joined: 19 Aug 2009 |
| Total Posts: 12795 |
|
|
| 21 Jul 2014 08:50 PM |
Oh you're talking about his script, :P
Well nvm. |
|
|
| Report Abuse |
|
|
Xephyric
|
  |
| Joined: 26 Mar 2009 |
| Total Posts: 2270 |
|
|
| 21 Jul 2014 08:51 PM |
| Did not see your script, I telling OP |
|
|
| Report Abuse |
|
|
Xephyric
|
  |
| Joined: 26 Mar 2009 |
| Total Posts: 2270 |
|
| |
|