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: Click

Previous Thread :: Next Thread 
JonathanW123 is not online. JonathanW123
Joined: 04 Apr 2012
Total Posts: 5832
23 Sep 2013 03:30 PM
How do I make it so if someone clicks a button in game.Workspace called Button (Part), then game.Workspace.Jail.Transparency = 0 and game.Workspace.Jail.CanCollide = false
Report Abuse
JonathanW123 is not online. JonathanW123
Joined: 04 Apr 2012
Total Posts: 5832
23 Sep 2013 03:47 PM
b1
Report Abuse
rosenburger is not online. rosenburger
Joined: 03 Aug 2009
Total Posts: 8407
23 Sep 2013 03:54 PM
local button = workspace.Button
button.Clicked:connect(function()
-- Put in your code here
end

~Professional ROBLOX Human
Report Abuse
JonathanW123 is not online. JonathanW123
Joined: 04 Apr 2012
Total Posts: 5832
23 Sep 2013 03:59 PM
what's the code?
Report Abuse
rosenburger is not online. rosenburger
Joined: 03 Aug 2009
Total Posts: 8407
23 Sep 2013 04:04 PM
You already have your code. Inside that anonymous function put what you want to happen when it is clicked. You wrote the code on the main post of this thread.

~Professional ROBLOX Human
Report Abuse
pikaard is not online. pikaard
Joined: 14 Nov 2012
Total Posts: 757
23 Sep 2013 04:06 PM
function onClick()
--SCRIPT
end

script.Parent.MouseClick:connect(onClick)
Report Abuse
RSFTheory is not online. RSFTheory
Joined: 31 Aug 2013
Total Posts: 315
23 Sep 2013 04:11 PM
open = false
b = game.Workspace.Button
c = game.Workspace.Door
function click()
c.CanCollide = false
c.Transparency = 1
elseif open == false then
c.CanCollide = true
c.Transparency = 0
end -- Not sure if it needs 1 or 2 ends. I'm a fail at scripting.
--I'm assuming you want a 1 button click, where if it is open, it closes, and if it is closed, it opens.
--This should work.
Report Abuse
RSFTheory is not online. RSFTheory
Joined: 31 Aug 2013
Total Posts: 315
23 Sep 2013 04:11 PM
Forgot something.

b.OnClick:connect(click)
Report Abuse
pikaard is not online. pikaard
Joined: 14 Nov 2012
Total Posts: 757
23 Sep 2013 04:12 PM
@Above; Wrong. It's Button.MouseClick:connect(onClick)
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