spin94631
|
  |
| Joined: 24 Jul 2012 |
| Total Posts: 51 |
|
|
| 25 Apr 2017 08:06 PM |
i trying to do it like this
config = script.Parent.Parent.Parent.Configuration
owners = config:GetChildren()
a = owners.className == "StringValue"
|
|
|
| Report Abuse |
|
|
jmt99
|
  |
| Joined: 27 Jul 2008 |
| Total Posts: 4799 |
|
|
| 25 Apr 2017 08:10 PM |
What do you mean "indexing" a bool?
|
|
|
| Report Abuse |
|
|
spin94631
|
  |
| Joined: 24 Jul 2012 |
| Total Posts: 51 |
|
|
| 25 Apr 2017 08:12 PM |
well im getting a error in the output that it could not "index boolean value" so what am i doing wrong?
|
|
|
| Report Abuse |
|
|
jmt99
|
  |
| Joined: 27 Jul 2008 |
| Total Posts: 4799 |
|
|
| 25 Apr 2017 08:15 PM |
Oh I see your problem now
"owners" is a table value of all the children in the config object, since you did config:GetChildren(), it's not a specific object, you would have to loop through the table like this or something:
local config = script.Parent.Parent.Parent.Configuration local owners = config:GetChildren() for _, child in pairs(owners) do local a = (child.ClassName == "StringValue") end
|
|
|
| Report Abuse |
|
|
spin94631
|
  |
| Joined: 24 Jul 2012 |
| Total Posts: 51 |
|
|
| 25 Apr 2017 08:21 PM |
ok so how would i go about indexing "a" so i can grab the name of the StringValue?
|
|
|
| Report Abuse |
|
|
jmt99
|
  |
| Joined: 27 Jul 2008 |
| Total Posts: 4799 |
|
|
| 25 Apr 2017 08:23 PM |
You need the name of the StringValue object?
local config = script.Parent.Parent.Parent.Configuration local owners = config:GetChildren() for _, child in pairs(owners) do local name = child.Name end
|
|
|
| Report Abuse |
|
|
spin94631
|
  |
| Joined: 24 Jul 2012 |
| Total Posts: 51 |
|
|
| 25 Apr 2017 08:26 PM |
not really im trying to make a admin list that will use the name of the StringValue as the admined player
|
|
|
| Report Abuse |
|
|
jmt99
|
  |
| Joined: 27 Jul 2008 |
| Total Posts: 4799 |
|
| |
|
jmt99
|
  |
| Joined: 27 Jul 2008 |
| Total Posts: 4799 |
|
|
| 25 Apr 2017 08:27 PM |
What is inside "script.Parent.Parent.Parent.Configuration"?
|
|
|
| Report Abuse |
|
|
spin94631
|
  |
| Joined: 24 Jul 2012 |
| Total Posts: 51 |
|
|
| 25 Apr 2017 08:28 PM |
StringValues named after the Admined players...
|
|
|
| Report Abuse |
|
|
jmt99
|
  |
| Joined: 27 Jul 2008 |
| Total Posts: 4799 |
|
|
| 25 Apr 2017 08:29 PM |
What I posted before is what you want then, that's how you would get the name of the StringValue instances inside "script.Parent.Parent.Parent.Configuration"
|
|
|
| Report Abuse |
|
|
spin94631
|
  |
| Joined: 24 Jul 2012 |
| Total Posts: 51 |
|
|
| 25 Apr 2017 08:33 PM |
ok so im going to rewrite the rest of the script i'll tell you if i get it working
|
|
|
| Report Abuse |
|
|
spin94631
|
  |
| Joined: 24 Jul 2012 |
| Total Posts: 51 |
|
|
| 25 Apr 2017 08:35 PM |
ok this is the script im trying to get to work what am i doing wrong!?!?!
player = script.Parent.Parent.Parent.Parent.Parent.Parent
local config = script.Parent.Parent.Parent.Configuration local owners = config:GetChildren() for _, child in pairs(owners) do local name = child.Name end
people = {name}
function check(plr) for i = 1, #people do if people[i]:lower() == plr.Name:lower() then return true end end end
while true do wait(0) if check(player) == true then script.Parent.Visible = true else script.Parent:Remove() end end
|
|
|
| Report Abuse |
|
|
jmt99
|
  |
| Joined: 27 Jul 2008 |
| Total Posts: 4799 |
|
|
| 25 Apr 2017 09:13 PM |
player = script.Parent.Parent.Parent.Parent.Parent.Parent local people = {}
local config = script.Parent.Parent.Parent.Configuration local owners = config:GetChildren() for _, child in pairs(owners) do table.insert(people, #people+1, child.Name) end
function check(plr) for i = 1, #people do if people[i]:lower() == plr.Name:lower() then return true end end end
while true do wait(0) if check(player) == true then script.Parent.Visible = true else script.Parent:Remove() end end
|
|
|
| Report Abuse |
|
|
spin94631
|
  |
| Joined: 24 Jul 2012 |
| Total Posts: 51 |
|
| |
|