|
| 06 Jun 2015 10:34 AM |
check = script.Parent.Parent.Transparency == 1
if check then script.Parent.Enabled = false else print("Checked") script.Pulse.Disabled = false end
Why no work?
(It suppose to check if the part is transparent and if it is then to turn off the pointlight and if it isn't to turn it on and run Pulse) |
|
|
| Report Abuse |
|
|
| |
|
|
| 06 Jun 2015 10:47 AM |
trs = script.Parent.Parent.Transparency
if trs >= 1 then script.Parent.Enabled = false elseif trs < 1 then print'Checked' script.Pulse.Disabled = false end |
|
|
| Report Abuse |
|
|
|
| 06 Jun 2015 10:48 AM |
| What about it doesn't work? Is it doing the wrong thing, or is it not doing anything at all? |
|
|
| Report Abuse |
|
|
|
| 06 Jun 2015 10:48 AM |
1) trs will never be greater than 1 2) if it's equal to one, we don't need to check if it is less than 1 |
|
|
| Report Abuse |
|
|
|
| 06 Jun 2015 10:50 AM |
k mang
if trs == 1 then
elseif trs == 0 then
*** |
|
|
| Report Abuse |
|
|
|
| 06 Jun 2015 10:56 AM |
@kingkiller1000 Nothing happens
|
|
|
| Report Abuse |
|
|
|
| 06 Jun 2015 10:56 AM |
| What if it's between 0 and 1? |
|
|
| Report Abuse |
|
|
| |
|
|
| 06 Jun 2015 10:59 AM |
| I set up a little test in studio, and your script works fine. Is this the whole script? |
|
|
| Report Abuse |
|
|
| |
|
|
| 06 Jun 2015 11:03 AM |
I don't know then.
By the way, my between 0 and 1 question was directed towards DeSpizer27. |
|
|
| Report Abuse |
|
|
|
| 06 Jun 2015 11:14 AM |
| My original script handled between 0 and 1 as 0. |
|
|
| Report Abuse |
|
|
|
| 06 Jun 2015 11:34 AM |
> if trs == 1 then > elseif trs == 0 then
Doesn't handle between 0 and 1. |
|
|
| Report Abuse |
|
|
|
| 06 Jun 2015 12:25 PM |
trs = script.Parent.Parent.Transparency
>if trs >= 1 then script.Parent.Enabled = false >elseif trs < 1 then print'Checked' script.Pulse.Disabled = false end
Handles between 0 and 1. |
|
|
| Report Abuse |
|
|
|
| 06 Jun 2015 09:59 PM |
| That's no different than the OP's script except putting the check in the if. |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 07 Jun 2015 12:48 AM |
part = script.Parent.Parent
if part.Transparency == 1 then script.Parent.Enabled = false else script.Pulse.Disabled = false end |
|
|
| Report Abuse |
|
|