|
| 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 |
|
|
| |
|
| |
|
| |
|
| |
|
| |
|
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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 17 Apr 2015 08:16 PM |
| Basics? Explain. The script works in studio.Just not online. |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 17 Apr 2015 08:22 PM |
| hmm.. maybe you need some waits you dummy |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| Joined: 28 Jul 2008 |
| Total Posts: 1254 |
|
|
| 17 Apr 2015 08:25 PM |
| What @TheScripterGeek said. |
|
|
| Report Abuse |
|
|
|
| 17 Apr 2015 08:26 PM |
| It doesn't work with waits. |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 17 Apr 2015 08:30 PM |
| And the values do not change at all? |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 18 Apr 2015 02:04 PM |
| I used Baldo's method, but made it even more readable with better variables. Thanks. |
|
|
| Report Abuse |
|
|