|
| 27 Dec 2012 03:24 PM |
Hi...
I'm trying to make a tool that on clicked, places a chair, deletes the tool, and deletes the chair the person placed last time.
I do not know how to use the onclick function. Can anyone show me how the onclick function works?
Thanks ahead!
~wickedXxxxlegoxxxx |
|
|
| Report Abuse |
|
|
goalzero
|
  |
| Joined: 29 Sep 2010 |
| Total Posts: 132 |
|
|
| 27 Dec 2012 03:28 PM |
Sounds cool! That a figure insert. Let me see... |
|
|
| Report Abuse |
|
|
|
| 27 Dec 2012 03:37 PM |
local chair = game.Lighting.Chair:Clone() local x = false
script.Parent.Selected:connect(function(m) m.Button1Down:connect(function() if not x then chair.Parent = workspace else chair.Parent = nil end x = not x end) end) |
|
|
| Report Abuse |
|
|
|
| 27 Dec 2012 03:38 PM |
woops sorry
local chair = game.Lighting.Chair:Clone() local x = false
script.Parent.Selected:connect(function(m) m.Button1Down:connect(function() if not x then chair.Parent = workspace chair:MoveTo(m.Hit.p + Vector3.new(0, 3, 0)) else chair.Parent = nil end x = not x end) end) |
|
|
| Report Abuse |
|
|
|
| 27 Dec 2012 04:11 PM |
| That didn't work. The model named Chair is in Lighting, I made a tool and inserted the script into the tool and put the tool in Starerpack. |
|
|
| Report Abuse |
|
|
| |
|
goalzero
|
  |
| Joined: 29 Sep 2010 |
| Total Posts: 132 |
|
| |
|
awas3
|
  |
| Joined: 24 Oct 2010 |
| Total Posts: 2854 |
|
|
| 27 Dec 2012 04:52 PM |
| Put it in a hopperbin not tool... |
|
|
| Report Abuse |
|
|