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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Button Clicked

Previous Thread :: Next Thread 
ServerStorage is not online. ServerStorage
Joined: 03 Oct 2013
Total Posts: 111
12 Jan 2014 12:18 PM
script.Parent.MouseButton1Click:connect(functiontest)
Not sure if this is right...
Report Abuse
iWasted1000Robux is not online. iWasted1000Robux
Joined: 26 Oct 2013
Total Posts: 813
12 Jan 2014 12:24 PM
go try it then

#nerdsunited
Report Abuse
ServerStorage is not online. ServerStorage
Joined: 03 Oct 2013
Total Posts: 111
12 Jan 2014 12:30 PM
I am but the button isn't working so i'm trying to figure out what the problem is...
Report Abuse
cycoboy83 is not online. cycoboy83
Joined: 31 May 2011
Total Posts: 831
12 Jan 2014 12:36 PM
It's MouseButton1Down, not Click.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
12 Jan 2014 12:38 PM
Click works.

OP, you are using a TextButton/ImageButton? If you are using a part, you're going to have to create a click detector and use the MouseClick event
Report Abuse
ServerStorage is not online. ServerStorage
Joined: 03 Oct 2013
Total Posts: 111
12 Jan 2014 12:40 PM
local bos = script.Parent.Parent.BorS

function test()
if bos.Value == false then
bos.Value = true
script.Parent.Text = "On"
end
if bos.Value == true then
bos.Value = false
script.Parent.Text = "Off"
end end

script.Parent.MouseButton1Click:connect(Test)

--Full script
--idk whats wrong
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
12 Jan 2014 12:42 PM
function test()
if bos.Value == false then
bos.Value = true
script.Parent.Text = "On"
elseif bos.Value == true then
bos.Value = false
script.Parent.Text = "Off"
end end

script.Parent.MouseButton1Click:connect(Test)
Report Abuse
Kingmouli is not online. Kingmouli
Joined: 28 Sep 2012
Total Posts: 1292
12 Jan 2014 12:42 PM
Is it in a GUI?

~Kingmouli, King of the Mouli~
Report Abuse
ServerStorage is not online. ServerStorage
Joined: 03 Oct 2013
Total Posts: 111
12 Jan 2014 12:45 PM
Now it's saying attempt to call a nil value..
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
12 Jan 2014 12:47 PM
I forgot to add the "local bos = script.Parent.Parent.BorS"
Report Abuse
ServerStorage is not online. ServerStorage
Joined: 03 Oct 2013
Total Posts: 111
12 Jan 2014 12:49 PM
Yes i know. But it's still saying Nil Value... and the value is there and yes its a boolvalue...
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
12 Jan 2014 12:52 PM
script.Parent.MouseButton1Click:connect(test)
Report Abuse
ServerStorage is not online. ServerStorage
Joined: 03 Oct 2013
Total Posts: 111
12 Jan 2014 12:54 PM
Sweet thanks now i can move on with the gui :3 still lots more to do. :p
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