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