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: Object value reading help.

Previous Thread :: Next Thread 
QuantumOscillation is online. QuantumOscillation
Joined: 12 May 2011
Total Posts: 105
08 Jul 2017 03:25 AM
so i have a StringValue and a table
how can i check if the Stringvalue's value is in the table?

contents;

table={a,b,c}

StringValue located in ServerStorage


StringValue's value is "b" as of now.
Report Abuse
BaiYuni is not online. BaiYuni
Joined: 09 Oct 2009
Total Posts: 2861
08 Jul 2017 03:28 AM
for _, v in pairs(table) do
if game:GetService("ServerStorage"):WaitForChild("Value").Value == v then
return true
end
end
Report Abuse
BaiYuni is not online. BaiYuni
Joined: 09 Oct 2009
Total Posts: 2861
08 Jul 2017 03:28 AM
But I don't think you created a table of String values.
Report Abuse
QuantumOscillation is online. QuantumOscillation
Joined: 12 May 2011
Total Posts: 105
08 Jul 2017 03:46 AM
script stops here

if game:GetService("ServerStorage"):WaitForChild("Value").Value == v then


and there's a warning[not error] on output: Infinite yield possible on 'ServerStorage:WaitForChild("Value")'
Report Abuse
QuantumOscillation is online. QuantumOscillation
Joined: 12 May 2011
Total Posts: 105
08 Jul 2017 03:58 AM
bump
Report Abuse
JoshRBX is not online. JoshRBX
Joined: 19 May 2012
Total Posts: 8778
08 Jul 2017 04:08 AM
local function checkStr(tbl)
for _, v in pairs(tbl) do
if type(v) == "string" then
return true
end
end
return false
end
Report Abuse
JoshRBX is not online. JoshRBX
Joined: 19 May 2012
Total Posts: 8778
08 Jul 2017 04:09 AM
misread, ignore my last post
you need to make sure that there is an object by the name of 'Value' located in the ServerStorage then.
Report Abuse
Isosta is not online. Isosta
Joined: 10 May 2015
Total Posts: 14729
08 Jul 2017 04:32 AM
you don't need getservice for default enabled services


Report Abuse
QuantumOscillation is online. QuantumOscillation
Joined: 12 May 2011
Total Posts: 105
08 Jul 2017 04:32 AM
uh no "StringValue" is an actual ObjectValue located in game.ServerStorage
lol

bump
Report Abuse
Isosta is not online. Isosta
Joined: 10 May 2015
Total Posts: 14729
08 Jul 2017 04:42 AM
you're doing something wrong.

what's the string value named


Report Abuse
Isosta is not online. Isosta
Joined: 10 May 2015
Total Posts: 14729
08 Jul 2017 04:42 AM
wait, is this a local or server script


Report Abuse
QuantumOscillation is online. QuantumOscillation
Joined: 12 May 2011
Total Posts: 105
08 Jul 2017 04:44 AM
solved. 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