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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
| |
|