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: Help With Script

Previous Thread :: Next Thread 
deshea9 is not online. deshea9
Joined: 07 Jan 2011
Total Posts: 276
21 Oct 2017 05:57 PM
The script will make the light turn on, but it will not do what is after the "else"
==========================

script.Parent.ClickDetector.MouseClick:connect(function()

if light1.Enabled == false then
light1.Enabled = true
if light2.Enabled == false then
light2.Enabled = true
if light3.Enabled == false then
light3.Enabled = true
if light4.Enabled == false then
light4.Enabled = true

light1On.BrickColor = BrickColor.new("Earth green")
lightsound:Play()

else

if light1.Enabled == true then
light1.Enabled = false
if light2.Enabled == true then
light2.Enabled = false
if light3.Enabled == true then
light3.Enabled = false
if light4.Enabled == true then
light4.Enabled = false

light1On.BrickColor = BrickColor.new("Really red")
lightsound:Play()
end
end
end
end
end
end
end
end
end)
Report Abuse
deshea9 is not online. deshea9
Joined: 07 Jan 2011
Total Posts: 276
21 Oct 2017 06:35 PM
anyone? please?
Report Abuse
deshea9 is not online. deshea9
Joined: 07 Jan 2011
Total Posts: 276
21 Oct 2017 09:40 PM
):
Report Abuse
hamburger621 is not online. hamburger621
Joined: 20 Apr 2013
Total Posts: 845
21 Oct 2017 09:42 PM
don't just post a wall of code and expect us to solve it for you
Report Abuse
deshea9 is not online. deshea9
Joined: 07 Jan 2011
Total Posts: 276
21 Oct 2017 09:46 PM
I don't expect you to solve it for me... just to give me some advice (ex: instead of "else" try doing this command ...)
Report Abuse
ThanksRoBama is not online. ThanksRoBama
Joined: 21 May 2017
Total Posts: 127
21 Oct 2017 09:46 PM
Uh... what exactly do you want the script to do?
Report Abuse
WildGuest is not online. WildGuest
Joined: 28 Feb 2010
Total Posts: 647
21 Oct 2017 09:48 PM
This is most of it except the colors may be off

script.Parent.ClickDetector.MouseClick:connect(function()
if light1.Enabled == false then
light1.Enabled = true
elseif light1.Enabled == true then
light1.Enabled = false
end

if light2.Enabled == false then
light2.Enabled = true
elseif light2.Enabled == true then
light2.Enabled = false
end

if light3.Enabled == false then
light3.Enabled = true
elseif light3.Enabled == true then
light3.Enabled = false
end

if light4.Enabled == false then
light4.Enabled = true
elseif light4.Enabled == true then
light4.Enabled = false
end

if light1.Enabled == false then
light1On.BrickColor = BrickColor.new("Earth green")
lightsound:Play()
elseif light1.Enabled == true then
light1On.BrickColor = BrickColor.new("Really red")
lightsound:Play()
end
end)


Report Abuse
deshea9 is not online. deshea9
Joined: 07 Jan 2011
Total Posts: 276
21 Oct 2017 09:48 PM
It's a lighting system, when you click a button it will enable all the lights... But it just doesn't do what is after the else, (which is lights off)
Report Abuse
deshea9 is not online. deshea9
Joined: 07 Jan 2011
Total Posts: 276
21 Oct 2017 09:49 PM
@wild Thanks man! I didn't realize I would use "ElseIf"
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