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: Buildboard GUI lights

Previous Thread :: Next Thread 
hanserpro is not online. hanserpro
Joined: 06 Nov 2010
Total Posts: 57
19 Nov 2011 09:06 PM
(Sorry if I spelled it wrong)
Ok so I want to create a a system that includes a button to turn off/on the blinking light. The lights scripts are listed here-

script.Parent.Adornee = script.Parent.Parent




2nd-


light = script.Parent

time = 0.2 -- Change this to the time inbetween On and Off.

while true do
light.Enabled = false --(off)
wait(time)
light.Enabled = true --(on)
wait(time)
end
Report Abuse
TheNewScripter is not online. TheNewScripter
Joined: 02 Mar 2010
Total Posts: 2432
19 Nov 2011 09:07 PM
light.Visible = true

I'm assuming script.Parent is a TextLabel / ImageLabel or something that is a Gui... If it is, this will work.
Report Abuse
hanserpro is not online. hanserpro
Joined: 06 Nov 2010
Total Posts: 57
19 Nov 2011 09:08 PM
wait what? I want to be able to control when the light blinks because right now it blinks by itself i tried scripting random junk but..
Report Abuse
TheNewScripter is not online. TheNewScripter
Joined: 02 Mar 2010
Total Posts: 2432
19 Nov 2011 09:12 PM
Oh...

    Time = 0.2 -- Change this to the time inbetween On and Off.
    CanBlink = true -- Just change this with the button
    
    while true do
        if CanBlink then
            light.Enabled = false --(off)
            wait(Time)
            light.Enabled = true --(on)
            wait(Time)
        end
    end
Report Abuse
hanserpro is not online. hanserpro
Joined: 06 Nov 2010
Total Posts: 57
19 Nov 2011 09:15 PM
Ok I know how to change how fast it blinks but can you help me with it by controlling its blinking with a separate button?
Report Abuse
TheNewScripter is not online. TheNewScripter
Joined: 02 Mar 2010
Total Posts: 2432
19 Nov 2011 09:18 PM
Ok... For the flashing light script, use this:

    repeat
        wait()
    until
        Game:FindFirstChild("CanBlink")

    Time = 0.2 -- Change this to the time inbetween On and Off.
    CanBlink = Game.CanBlink.Value -- Just change this with the button
    
    while true do
        if CanBlink then
            light.Enabled = false --(off)
            wait(Time)
            light.Enabled = true --(on)
            wait(Time)
        end
    end

And for the button script, use this:

    local Bool = Instance.new("BoolValue", Game)
    Bool.Name = "CanBlink"
    Bool.Value = true
    
    MouseClicked = function(Player)
        Bool.Value = not Bool.Value
        -- If it's true, it turns to false;
        -- If it's false, it turns to true.
    end
    
    script.Parent.MouseClicked:connect(MouseClick)
Report Abuse
hanserpro is not online. hanserpro
Joined: 06 Nov 2010
Total Posts: 57
19 Nov 2011 09:25 PM
Ok I'm going to test it. What should i name the pieces?
Report Abuse
UpTightBodyBuilder is not online. UpTightBodyBuilder
Joined: 06 Nov 2010
Total Posts: 86
19 Nov 2011 09:38 PM
... name it w/e
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