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 » Scripting Helpers
Home Search
 

Re: Script wont work

Previous Thread :: Next Thread 
blackhalodude is not online. blackhalodude
Joined: 16 Jun 2010
Total Posts: 412
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 is not online. Grove537
Joined: 05 Feb 2010
Total Posts: 3478
10 Feb 2012 06:35 PM
Add Quotes around "RobloxButtonDefault" and "RobloxButton"
Report Abuse
blackhalodude is not online. blackhalodude
Joined: 16 Jun 2010
Total Posts: 412
10 Feb 2012 06:38 PM
Output = attempt to call a nil value
Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
10 Feb 2012 06:40 PM
what line?
Report Abuse
blackhalodude is not online. blackhalodude
Joined: 16 Jun 2010
Total Posts: 412
10 Feb 2012 06:43 PM
Is it ok if the style is a dropdown thing
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
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
blackhalodude is not online. blackhalodude
Joined: 16 Jun 2010
Total Posts: 412
10 Feb 2012 06:47 PM
@KnightmareXD
nothing
Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
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
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
10 Feb 2012 06:48 PM
@Cody

Again no...

† KMXD †
Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
10 Feb 2012 06:48 PM
omg yea...

Button.MouseButton1Down:connect(OnClick)
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
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
blackhalodude is not online. blackhalodude
Joined: 16 Jun 2010
Total Posts: 412
10 Feb 2012 06:50 PM
@cody123454321
again nothing
Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
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
blackhalodude is not online. blackhalodude
Joined: 16 Jun 2010
Total Posts: 412
10 Feb 2012 06:52 PM
@KnightmareXD
Yes
Report Abuse
blackhalodude is not online. blackhalodude
Joined: 16 Jun 2010
Total Posts: 412
10 Feb 2012 06:56 PM
@cody123454321
didnt work
Report Abuse
HolyBanana is not online. HolyBanana
Joined: 13 Sep 2010
Total Posts: 1417
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
blackhalodude is not online. blackhalodude
Joined: 16 Jun 2010
Total Posts: 412
10 Feb 2012 07:02 PM
does the ; afect the script?
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
10 Feb 2012 07:03 PM
@Black

No.

† KMXD †
Report Abuse
HolyBanana is not online. HolyBanana
Joined: 13 Sep 2010
Total Posts: 1417
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
blackhalodude is not online. blackhalodude
Joined: 16 Jun 2010
Total Posts: 412
10 Feb 2012 07:06 PM
@HolyBanana
nothing
Report Abuse
HolyBanana is not online. HolyBanana
Joined: 13 Sep 2010
Total Posts: 1417
10 Feb 2012 07:09 PM
Then it is not a script issue and we cannot help.
Report Abuse
HolyBanana is not online. HolyBanana
Joined: 13 Sep 2010
Total Posts: 1417
10 Feb 2012 07:09 PM
I just tested in my own Gui. It worked for me fine.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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