generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: how would you go about indexing a boolean value

Previous Thread :: Next Thread 
spin94631 is not online. 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 is online. jmt99
Joined: 27 Jul 2008
Total Posts: 4799
25 Apr 2017 08:10 PM
What do you mean "indexing" a bool?


Report Abuse
spin94631 is not online. 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 is online. 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 is not online. 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 is online. 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 is not online. 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 is online. jmt99
Joined: 27 Jul 2008
Total Posts: 4799
25 Apr 2017 08:26 PM
That's what I said


Report Abuse
jmt99 is online. 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 is not online. spin94631
Joined: 24 Jul 2012
Total Posts: 51
25 Apr 2017 08:28 PM
StringValues named after the Admined players...


Report Abuse
jmt99 is online. 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 is not online. 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 is not online. 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 is online. 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 is not online. spin94631
Joined: 24 Jul 2012
Total Posts: 51
25 Apr 2017 09:22 PM
thanks for the help ^^


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image