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: BoolValue Won't Change

Previous Thread :: Next Thread 
Astrock is not online. Astrock
Joined: 06 Jun 2010
Total Posts: 240
03 Aug 2015 07:06 PM
This seems incredibly easy and simple to do, yet the value will not change. I have it set on true, and when I run the script it stays true. No error pops up. While I could just use a number value, and make 0 = false, 1 = true, this has been a recurring problem that vexes me. Here is the script that doesn't seem to work:

local state = script.Parent.Parent.State.Value --State is the name of my BoolValue

state = false

I tried to put a new script as a child of the BoolValue, but that too did not work. Here is that script:

script.Parent.Value = false
Report Abuse
PearSprite is not online. PearSprite
Joined: 02 Jul 2015
Total Posts: 230
03 Aug 2015 07:12 PM
The latter piece of code should work fine, unless you changed it somewhere else or the script is disabled. The first one doesn't work because you're setting a variable to your BoolValue's current value, then setting that variable instead of the BoolValue.
Report Abuse
Astrock is not online. Astrock
Joined: 06 Jun 2010
Total Posts: 240
03 Aug 2015 07:16 PM
The script of the latter is activated, and just to make sure nothing else was changing it too, I disabled every other script.
Report Abuse
Techante is not online. Techante
Joined: 17 Oct 2011
Total Posts: 2101
03 Aug 2015 07:21 PM
try this:

local state = script.Parent.Parent.State

state.Value = false
Report Abuse
Astrock is not online. Astrock
Joined: 06 Jun 2010
Total Posts: 240
03 Aug 2015 07:31 PM
With some troubleshooting, it appears that manually checking it's value won't give it's real value. I used this script:

script.Parent.Value = false
print (script.Parent.Value)

if script.Parent.Value == false then
print ('The value is false')
end

if script.Parent.Value == true then
print ('The value is true')
end

And the output is always:

false
"The value is false"

I was checking the little box in the BoolValue that can be check-marked or not to see if the value is true or false. Looking at the box does not give you the value it seems. The check-mark does not remove itself or add itself when the value changes. But, apparently, it only represents the real value of the BoolValue if that check-mark box was manually changed by the player.
Report Abuse
cooldude999921 is not online. cooldude999921
Joined: 13 Aug 2011
Total Posts: 3702
03 Aug 2015 07:34 PM
when the game runs, that script runs once so if something changes it to true then rip it wont detect it..


try dis


local val = script.Parent.Value

val.Changed:connect(function(prop)
if prop == "Value" then
print("The value is "..tostring(prop.Value))
end end)



ʏᴏᴜ ᴛʜᴏᴜɢʜᴛ ʏᴏᴜ ᴄᴏᴜʟᴅ ᴅʀᴀɢ ᴍᴇ ᴛᴏ ᴛʜᴇ ʙᴏᴛᴛᴏᴍ ᴏғ ᴛʜᴇ ʟᴀᴋᴇ sᴏ ʏᴏᴜ ᴄᴏᴜʟᴅ ᴇᴀᴛ ᴍᴇ ʟᴀᴛᴇʀ... ᴡᴇʟʟ ɢᴜᴇss ᴡʜᴀᴛ ᴘᴜɴᴋ... ɪᴍ ᴀ ғɪsʜ... ᴡɪᴛʜ ʟᴇɢs
Report Abuse
cooldude999921 is not online. cooldude999921
Joined: 13 Aug 2011
Total Posts: 3702
03 Aug 2015 07:36 PM
my code will run every time you change the value so whatever you change it to it will print.




ʏᴏᴜ ᴛʜᴏᴜɢʜᴛ ʏᴏᴜ ᴄᴏᴜʟᴅ ᴅʀᴀɢ ᴍᴇ ᴛᴏ ᴛʜᴇ ʙᴏᴛᴛᴏᴍ ᴏғ ᴛʜᴇ ʟᴀᴋᴇ sᴏ ʏᴏᴜ ᴄᴏᴜʟᴅ ᴇᴀᴛ ᴍᴇ ʟᴀᴛᴇʀ... ᴡᴇʟʟ ɢᴜᴇss ᴡʜᴀᴛ ᴘᴜɴᴋ... ɪᴍ ᴀ ғɪsʜ... ᴡɪᴛʜ ʟᴇɢs
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