|
| 10 Feb 2012 06:33 PM |
Their is nothing in the output
local Button = script.Parent function OnClick() if Button.Style == RobloxButtonDefault then Button.Style = RobloxButton
if Button.Style == RobloxButton then Button.Style = RobloxButtonDefault
end end end Button.MouseButton1Down:connect() |
|
|
| Report Abuse |
|
|
Grove537
|
  |
| Joined: 05 Feb 2010 |
| Total Posts: 3478 |
|
|
| 10 Feb 2012 06:35 PM |
| Add Quotes around "RobloxButtonDefault" and "RobloxButton" |
|
|
| Report Abuse |
|
|
|
| 10 Feb 2012 06:38 PM |
Output = attempt to call a nil value
|
|
|
| Report Abuse |
|
|
| |
|
|
| 10 Feb 2012 06:43 PM |
| Is it ok if the style is a dropdown thing |
|
|
| Report Abuse |
|
|
|
| 10 Feb 2012 06:44 PM |
local Button = script.Parent
Button.MouseButton1Down:connect(function() if Button.Style == "RobloxButtonDefault" then Button.Style = "RobloxButton" elseif Button.Style == "RobloxButton" then Button.Style = "RobloxButtonDefault" end end)
† KMXD † |
|
|
| Report Abuse |
|
|
| |
|
|
| 10 Feb 2012 06:47 PM |
local Button = script.Parent function OnClick() if Button.Style == "RobloxButtonDefault" then Button.Style = "RobloxButton"
if Button.Style == "RobloxButton" then Button.Style = "RobloxButtonDefault"
end end end Button.MouseButton1Down:connect() |
|
|
| Report Abuse |
|
|
| |
|
|
| 10 Feb 2012 06:48 PM |
omg yea...
Button.MouseButton1Down:connect(OnClick) |
|
|
| Report Abuse |
|
|
|
| 10 Feb 2012 06:49 PM |
@Black
Are you sure that those are the EXACT choices for the Style property? And is this script a child of the button you want to change?
† KMXD † |
|
|
| Report Abuse |
|
|
|
| 10 Feb 2012 06:50 PM |
@cody123454321 again nothing |
|
|
| Report Abuse |
|
|
|
| 10 Feb 2012 06:51 PM |
also i put it in script builder and it said
Failed to index local '1' Button
i think you need to delocalize the Button |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 10 Feb 2012 06:59 PM |
local Button = script.Parent function OnClick() if Button.Style == RobloxButtonDefault then Button.Style = RobloxButton
if Button.Style == RobloxButton then Button.Style = RobloxButtonDefault
end end end Button.MouseButton1Down:connect()
script.Parent.MouseButton1Down:connect(function() if script.Parent.Style == "RobloxButtonDefault" then script.Parent.Style = "RobloxButton"; else script.Parent.Style = "RobloxButtonDefault"; end end); -- Don't ask why I love using ; at the end of lines. It's a PHP/JS habit. |
|
|
| Report Abuse |
|
|
|
| 10 Feb 2012 07:02 PM |
does the ; afect the script?
|
|
|
| Report Abuse |
|
|
| |
|
|
| 10 Feb 2012 07:05 PM |
@Black
No. However, mostly all programming languages require ; at the end of each line so it can parse. I code over 14 other languages regulary, so it is a habit I cannot escape from. |
|
|
| Report Abuse |
|
|
| |
|
|
| 10 Feb 2012 07:09 PM |
| Then it is not a script issue and we cannot help. |
|
|
| Report Abuse |
|
|
|
| 10 Feb 2012 07:09 PM |
| I just tested in my own Gui. It worked for me fine. |
|
|
| Report Abuse |
|
|