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: Is it possible to check for a boolean to see if its true...

Previous Thread :: Next Thread 
Embolden is not online. Embolden
Joined: 02 May 2009
Total Posts: 148
27 May 2015 01:15 PM
Can you see if a boolean is true on a different script like this...

else if workspace["Swimming Pool"].part2.Script.Debouncer == true then

as it is saying Debouncer is not a valid member of Script in part2....
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
27 May 2015 01:18 PM
Apparently Debouncer does not exist. Use WaitForChild maybe?

Also, don't do
if Bool == true then
do
if Bool then

Because == compares it to something. It returns a Boolean.
In other words, if Bool is false, it looks like
if false == true then
or
if false then
since false == true equals false.

If Bool was true, it looks like
if true == true then
or
if true then
since true == true equals true.

And "else if" is incorrect, you are wanting "elseif", with no space.
Report Abuse
ganger800 is not online. ganger800
Joined: 06 Dec 2012
Total Posts: 427
27 May 2015 01:18 PM
you can't access variables from inside the script like that
I recommend to use global table or an bindable even/function

_G.Debouncer = true

and you can read it somewhere else like
if (_G.Debouncer) then
Report Abuse
Embolden is not online. Embolden
Joined: 02 May 2009
Total Posts: 148
27 May 2015 01:21 PM
may i ask what (_G.Debouncer) means please?
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
27 May 2015 01:22 PM
_G is a table that works between scripts (But not between Scripts and LocalScripts, since they run on different computers)
Report Abuse
Embolden is not online. Embolden
Joined: 02 May 2009
Total Posts: 148
27 May 2015 01:26 PM
so if you got _G.Debouncer = true

and on your other script you just put else if _G.Debouncer == true then

blaah blahh


so its like a teleporter into a different dimension bassically??
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
27 May 2015 01:27 PM
Yep. Basically.
Report Abuse
Locard is not online. Locard
Joined: 13 Apr 2014
Total Posts: 3516
27 May 2015 01:28 PM
"so its like a teleporter into a different dimension bassically??"

A wild imitation I must say. But to answer that, yes.
Report Abuse
Embolden is not online. Embolden
Joined: 02 May 2009
Total Posts: 148
27 May 2015 01:28 PM
So, on my script were you have to touch before you go to the finish line

How would I make the variable/Boolean a _G.Debouncer = true
Report Abuse
Embolden is not online. Embolden
Joined: 02 May 2009
Total Posts: 148
27 May 2015 01:36 PM
BTW there is lots of different things people don't know about,

For Example...

And "else if" is incorrect, you are wanting "elseif", with no space.

Doesn't matter dude

also instead of game.workspace ... you can just do workspace

I like my code looking as clean as possible :D
Report Abuse
Intern33t is not online. Intern33t
Joined: 19 Nov 2010
Total Posts: 1530
27 May 2015 01:40 PM
1. Nonononononononoooo.
"elseif" and "else if" are two diffrent things.
You might think they do the same, but the following syntax is totally different.

2. it would be game.Workspace, not game.workspace. Don't mix it up.

~ᵂʰᵒ ᵃʳᵉ ʸᵒᵘ ᵗᵒᵈᵃʸ﹖~
Report Abuse
Embolden is not online. Embolden
Joined: 02 May 2009
Total Posts: 148
27 May 2015 01:45 PM
whoa, whoa, whoa, Game.workspace and game.workspace is the exact same and elseif and else if is the exact same as well lol
Report Abuse
Intern33t is not online. Intern33t
Joined: 19 Nov 2010
Total Posts: 1530
27 May 2015 01:52 PM
1. These are deprecated:

Game
Game.workspace
Game.Workspace
game.workspace --this WAS an error previously

This is okay:

workspace
game.Workspace

2.

elseif example:

if v.Name == "Part" then
v.Name = "NotPart"
elseif v.Name == "Part2" then
v.Name = "NotPart2"
end

else if example:

if v.Name == "Part" then
v.Name = "NotPart"
else if v.Name == "Part2" then
v.Name = "NotPart2"
end end --See this double end? Remove one and you will error.

elseif checks for ANOTHER condition (like "or" but with 2 things to do)

else if checks FIRST FOR ANY OTHER CONDITION, then FOR YOUR SPECIFIC CONDITION.

~ᵂʰᵒ ᵃʳᵉ ʸᵒᵘ ᵗᵒᵈᵃʸ﹖~
Report Abuse
Embolden is not online. Embolden
Joined: 02 May 2009
Total Posts: 148
27 May 2015 01:53 PM
Oh right thank you for noting that sorry for arguing I actually never knew that :P

Cheers dude!
Report Abuse
Embolden is not online. Embolden
Joined: 02 May 2009
Total Posts: 148
27 May 2015 02:05 PM
Okay about _G Found a solution and now my thing is fixed thanks guys! :D
_G.Debouncer = false
Thank you!!
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