Vitalityc
|
  |
| Joined: 02 Aug 2013 |
| Total Posts: 302 |
|
|
| 21 Jul 2017 10:31 AM |
script.Parent.ClickDetector.MouseClick:connect(function() print(script.Parent.Material) if script.Parent.Material=="Neon" then print("is neon") script.Parent.Material="Smooth Plastic" script.Parent.PointLight.Enabled=false else print("is not neon") script.Parent.Material="Neon" script.Parent.PointLight.Enabled=true
end end)
OUTPUT: Enum.Material.Neon is not neon _______________________________ If the material is neon why is it going to the else part
I'm stuck |
|
|
| Report Abuse |
|
|
qrushed
|
  |
| Joined: 10 Apr 2012 |
| Total Posts: 587 |
|
|
| 21 Jul 2017 10:34 AM |
try comparing it with the Enum?
If it does have comparability with strings try lower case?
|
|
|
| Report Abuse |
|
|
LaeMVP
|
  |
| Joined: 24 Jun 2013 |
| Total Posts: 4416 |
|
|
| 21 Jul 2017 10:34 AM |
| Material is an Enum not a String? |
|
|
| Report Abuse |
|
|
Vitalityc
|
  |
| Joined: 02 Aug 2013 |
| Total Posts: 302 |
|
|
| 21 Jul 2017 10:43 AM |
| @LaeMVP I'm still basically learning so I don't really know enum and string.. I'm lost LOL |
|
|
| Report Abuse |
|
|
qrushed
|
  |
| Joined: 10 Apr 2012 |
| Total Posts: 587 |
|
|
| 21 Jul 2017 10:46 AM |
There a different types of Data in Lua Strings Numbers Functions ... and UserData
ROBLOX defined a bunch of UserData types like: Enums Vector2s Vector3s UDims UDim2s ...
You should get the picture, lel.
the list of different Enums is massive you can check it out on the wiki
You can often set Properties that want an Enum with string values because that's just user friendly... But it's suggested you just use the Enum values for everything. |
|
|
| Report Abuse |
|
|
Vitalityc
|
  |
| Joined: 02 Aug 2013 |
| Total Posts: 302 |
|
|
| 21 Jul 2017 10:50 AM |
| Oh I see, I'll test it out and see if I understood. I'll reply back again if I don't get it. |
|
|
| Report Abuse |
|
|