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 » Scripting Helpers
Home Search
 

Re: I need a little help...

Previous Thread :: Next Thread 
pikaard is not online. pikaard
Joined: 14 Nov 2012
Total Posts: 757
21 Aug 2013 11:57 PM
I'm making a script, but, I want to make it like:
One button turns on:

function onClicked()
script.Parent.Value.Value = true
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)

Then:
One button turns off:

function onClicked()
script.Parent.Value.Value = false
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)

If it's true, it's on, if it's false, it's off, but I don't know how to make a script, like, I tried:

if script.Parent.Value.Value = true then
(SCRIPT)
end

But I know it's wrong, what do I do so it works?
Report Abuse
pikaard is not online. pikaard
Joined: 14 Nov 2012
Total Posts: 757
22 Aug 2013 12:05 AM
Can someone help? Please?
Report Abuse
Soquick is not online. Soquick
Joined: 01 Nov 2012
Total Posts: 1497
22 Aug 2013 12:20 AM
Make the if a function the one that checks if its true
script.Parent.Parent.Value.Changed:connect(functionname)
Report Abuse
pikaard is not online. pikaard
Joined: 14 Nov 2012
Total Posts: 757
22 Aug 2013 12:23 AM
So.. I just add:



script.Parent.Parent.Value.Changed:connect(functionname)


Hm?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
22 Aug 2013 12:26 AM
if value is not an object, then that won't work
Report Abuse
Soquick is not online. Soquick
Joined: 01 Nov 2012
Total Posts: 1497
22 Aug 2013 12:31 AM
script.Parent.Parent.Value.Changed:connect(function()
if script.Parent.Parent.Value.Value == true then
Code
end
end)
Report Abuse
pikaard is not online. pikaard
Joined: 14 Nov 2012
Total Posts: 757
22 Aug 2013 12:32 AM
It's a BoolValue. If it's true, it's on, false is off.
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
22 Aug 2013 12:33 AM
if Value == true then

OR

if Value then
Report Abuse
pikaard is not online. pikaard
Joined: 14 Nov 2012
Total Posts: 757
22 Aug 2013 12:35 AM
Thanks soquick.
Report Abuse
Soquick is not online. Soquick
Joined: 01 Nov 2012
Total Posts: 1497
22 Aug 2013 12:43 AM
Non it doesn't matter. I didn't want to change his code to much
Report Abuse
pikaard is not online. pikaard
Joined: 14 Nov 2012
Total Posts: 757
22 Aug 2013 12:52 AM
It didn't work.
Report Abuse
Soquick is not online. Soquick
Joined: 01 Nov 2012
Total Posts: 1497
22 Aug 2013 12:53 AM
Output?
Report Abuse
pikaard is not online. pikaard
Joined: 14 Nov 2012
Total Posts: 757
22 Aug 2013 12:54 AM
Hm?
Report Abuse
pikaard is not online. pikaard
Joined: 14 Nov 2012
Total Posts: 757
22 Aug 2013 12:55 AM
script.Parent.Parent.Value.Changed:connect(function()
if script.Parent.Value.Value == true then
while true do
(SCRIPT)
end
while true do
(SCRIPT)
end
end
end)
Report Abuse
Soquick is not online. Soquick
Joined: 01 Nov 2012
Total Posts: 1497
22 Aug 2013 12:58 AM
Change script.Parent.Parent.Value.Changed:connect()
To
script.Parent.Value.Changed:connect()
Report Abuse
Soquick is not online. Soquick
Joined: 01 Nov 2012
Total Posts: 1497
22 Aug 2013 12:59 AM
You need a while wait() do not while true do or will freeze game
Report Abuse
pikaard is not online. pikaard
Joined: 14 Nov 2012
Total Posts: 757
22 Aug 2013 12:59 AM
No wonder why. XD
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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