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: Doesn't work?

Previous Thread :: Next Thread 
SurfaceLight is not online. SurfaceLight
Joined: 06 Apr 2014
Total Posts: 7574
17 Apr 2015 07:51 PM
while wait() do
Possible mistake here --> if game.Workspace.RedPart.PointLight.Enabled == true and game.Workspace.BluePart.PointLight.Enabled == true then
game.Workspace.Status.SurfaceGui.Status.Status.Text = "Colors Active!"
Possible mistake here --> elseif game.Workspace.RedPart.PointLight.Enabled == false and game.Workspace.BluePart.PointLight.Enabled == false then
game.Workspace.Status.SurfaceGui.Status.Status.Text = "Colors Inactive!"
elseif game.Workspace.RedPart.PointLight.Enabled == true then
game.Workspace.Status.SurfaceGui.Status.Status.Text = "Red Active!"
elseif game.Workspace.BluePart.PointLight.Enabled == true then
game.Workspace.Status.SurfaceGui.Status.Status.Text = "Blue Active!"
elseif game.Workspace.RedPart.PointLight.Enabled == false then
game.Workspace.Status.SurfaceGui.Status.Status.Text = "Red Inactive!"
elseif game.Workspace.BluePart.PointLight.Enabled == false then
game.Workspace.Status.SurfaceGui.Status.Status.Text = "Blue Inactive!"
end
end
Report Abuse
SurfaceLight is not online. SurfaceLight
Joined: 06 Apr 2014
Total Posts: 7574
17 Apr 2015 07:55 PM
Someone?
Report Abuse
SurfaceLight is not online. SurfaceLight
Joined: 06 Apr 2014
Total Posts: 7574
17 Apr 2015 07:59 PM
Bump
Report Abuse
SurfaceLight is not online. SurfaceLight
Joined: 06 Apr 2014
Total Posts: 7574
17 Apr 2015 08:03 PM
B2
Report Abuse
SurfaceLight is not online. SurfaceLight
Joined: 06 Apr 2014
Total Posts: 7574
17 Apr 2015 08:08 PM
B3
Report Abuse
SurfaceLight is not online. SurfaceLight
Joined: 06 Apr 2014
Total Posts: 7574
17 Apr 2015 08:10 PM
B4
Report Abuse
amanda is not online. amanda
Joined: 21 Nov 2006
Total Posts: 5925
17 Apr 2015 08:12 PM
I have a link that will help you tremendously.

https://www.youtube.com/watch?v=v3dbJXSa12Q&list=PLXX6hhg4CysYf0M-_GtCEOgGlkBfrXsoJ

Make sure not to skip the one called 'Variables'. I recommend all of them though.
Report Abuse
SurfaceLight is not online. SurfaceLight
Joined: 06 Apr 2014
Total Posts: 7574
17 Apr 2015 08:14 PM
Properties? Seriously. I know properties. And also, you still don't help. I need a script, not some link that won't help me resolve my problem.
Report Abuse
amanda is not online. amanda
Joined: 21 Nov 2006
Total Posts: 5925
17 Apr 2015 08:15 PM
It will DEFINITELY resolve your problem. Your problem is you do not know the basics of scripting.
Report Abuse
SurfaceLight is not online. SurfaceLight
Joined: 06 Apr 2014
Total Posts: 7574
17 Apr 2015 08:16 PM
Basics? Explain. The script works in studio.Just not online.
Report Abuse
SurfaceLight is not online. SurfaceLight
Joined: 06 Apr 2014
Total Posts: 7574
17 Apr 2015 08:18 PM
+ I'm not watching 20 scripting videos just to fix it. Too much time taken to fix a 15 line script.
Report Abuse
amanda is not online. amanda
Joined: 21 Nov 2006
Total Posts: 5925
17 Apr 2015 08:20 PM
Oh, I can assure you it is worth it, because it won't just fix this script, but provide solutions to many other of your scripts, past and future, as well as make you a better more intuitive scripter in general.
Report Abuse
CbasTheFish is not online. CbasTheFish
Joined: 05 Jul 2010
Total Posts: 59
17 Apr 2015 08:21 PM
Its not just to fix a script, it helps with later on since you know more.

Better "waste time" now than later
Report Abuse
TheScripterGeek is not online. TheScripterGeek
Joined: 02 Sep 2012
Total Posts: 1192
17 Apr 2015 08:22 PM
hmm.. maybe you need some waits you dummy
Report Abuse
SurfaceLight is not online. SurfaceLight
Joined: 06 Apr 2014
Total Posts: 7574
17 Apr 2015 08:23 PM
At least I scripted this before asking the forums to make me it though. + I can't focus on remembering so much about scripting since school. So. Pointless. But I'll look some up tomorrow and sunday.

Btw, there's nothing wrong with this script.

Regular script in the frame.

Tried a localscript in the frame, and tested each times and no output errors, etc. It has to do with other parts of the workspace, so I'm pretty sure that is why it doesn't work in online mode.
Report Abuse
SurfaceLight is not online. SurfaceLight
Joined: 06 Apr 2014
Total Posts: 7574
17 Apr 2015 08:24 PM
@thescripter, it needs none, because, it all needs to work when something is pressed, and does it right away.
Report Abuse
baldo46 is not online. baldo46
Joined: 28 Jul 2008
Total Posts: 1254
17 Apr 2015 08:25 PM
What @TheScripterGeek said.
Report Abuse
SurfaceLight is not online. SurfaceLight
Joined: 06 Apr 2014
Total Posts: 7574
17 Apr 2015 08:26 PM
It doesn't work with waits.
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
17 Apr 2015 08:28 PM
Wait wait wait...explain what the problem is again?
Report Abuse
SurfaceLight is not online. SurfaceLight
Joined: 06 Apr 2014
Total Posts: 7574
17 Apr 2015 08:28 PM
There are two parts in workspace, the script is in the frame. It's supposed to change text values of pointlights are enabled or not.
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
17 Apr 2015 08:30 PM
And the values do not change at all?
Report Abuse
SurfaceLight is not online. SurfaceLight
Joined: 06 Apr 2014
Total Posts: 7574
17 Apr 2015 08:31 PM
I just updated it. So just go to my place 72 if you want to see what's going on.
Report Abuse
baldo46 is not online. baldo46
Joined: 28 Jul 2008
Total Posts: 1254
17 Apr 2015 08:32 PM
while wait() do
--Your first problem is not using variables
redPart = game.Workspace.RedPart
redLight = redPart.PointLight
bluePart = game.Workspace.BluePart
blueLight = bluePart.PointLight
statusPart = game.Workspace.Status
statusGui = statusPart.SurfaceGui.Status.Status

--Second criticism is don't put ==true, just put the value

if redLight.Enabled and blueLight.Enabled then
statusGui.Text = "Colors Active!"
elseif not redLight.Enabled and not blueLight.Enabled then
statusGui.Text = "Colors Inactive!"
elseif redLight.Enabled then
statusGui.Text = "Red Active!"
elseif blueLight.Enabled then
statusGui.Text = "Blue Active!"
elseif not redLight.Enabled then
statusGui.Text = "Red Inactive!"
elseif not blueLight.Enabled then
statusGui.Text = "Blue Inactive!"
end

--Now that the code is readable, I can tell you that your major problem is using a while loop instead of listeners.
end

Basically, you need to use eventListeners to detect when they change instead of using a while loop b/c super unnecessary.
Report Abuse
SurfaceLight is not online. SurfaceLight
Joined: 06 Apr 2014
Total Posts: 7574
18 Apr 2015 02:04 PM
I used Baldo's method, but made it even more readable with better variables. Thanks.
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