|
| 20 May 2013 06:47 PM |
So...
function OnClicked(Part) Workspace.P1.Position = -12.5, 6.2, 18
So I tryed to make a Part in Workspace moved the part name is P1 For some reason this is not working |
|
|
| Report Abuse |
|
|
killjoy37
|
  |
| Joined: 27 Aug 2008 |
| Total Posts: 2821 |
|
|
| 20 May 2013 06:56 PM |
| Workspace.P1.Position = Vector3.new(-12.5, 6.2, 18) |
|
|
| Report Abuse |
|
|
| |
|
grimm343
|
  |
| Joined: 18 Sep 2008 |
| Total Posts: 2796 |
|
|
| 20 May 2013 07:58 PM |
| Add an 'end' to the function, and call the function. |
|
|
| Report Abuse |
|
|
|
| 20 May 2013 07:58 PM |
| Oh yeah all functions need an end.And whats a call? |
|
|
| Report Abuse |
|
|
grimm343
|
  |
| Joined: 18 Sep 2008 |
| Total Posts: 2796 |
|
|
| 20 May 2013 08:00 PM |
You can call it using..
OnClicked()
Or you can use a connection line, so the function is called when an event is triggered..
For example, if this script is inside of a brick. script.Parent.Touched:connect(OnClicked()) |
|
|
| Report Abuse |
|
|
|
| 20 May 2013 08:07 PM |
So I came up with this function OnClicked(Part) Workspace.P1.Position = -12.5, 6.2, 18
script.Parent.Touched:connect(OnClicked()) end
Still won't work |
|
|
| Report Abuse |
|
|
|
| 20 May 2013 08:09 PM |
| The wonders of scripting... |
|
|
| Report Abuse |
|
|
grimm343
|
  |
| Joined: 18 Sep 2008 |
| Total Posts: 2796 |
|
|
| 20 May 2013 08:10 PM |
You still need to do what the other user suggested. Also, the end goes before the connection.
function OnClicked() Workspace.P1.Position = Vector3.new(-12.5,6.2,18) end script.Parent.Touched:connect(OnClicked()) |
|
|
| Report Abuse |
|
|
|
| 20 May 2013 08:11 PM |
function OnClicked(Part) Workspace.P1.Position = Vector3.new(-12.5, 6.2, 18)--Vector3.new() end--end in wrong place script.Parent.Touched:connect(OnClicked) --()?
|
|
|
| Report Abuse |
|
|
grimm343
|
  |
| Joined: 18 Sep 2008 |
| Total Posts: 2796 |
|
|
| 20 May 2013 08:15 PM |
| Mhmm. That's just about the same as what I posted. |
|
|
| Report Abuse |
|
|
grimm343
|
  |
| Joined: 18 Sep 2008 |
| Total Posts: 2796 |
|
|
| 20 May 2013 08:16 PM |
| Except mine was wrong and yours was right. :P |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 20 May 2013 08:19 PM |
...So I came up with this function OnClicked() then Workspace.P1.Position = Vector3.new(-12.5,6.2,18) end script.Parent.Touched:connect(OnClicked())
The thing that is new is the then so when I click the part it the will move |
|
|
| Report Abuse |
|
|
| |
|
|
| 20 May 2013 08:23 PM |
S.O.S HELP THIS GUY (------------------------------------ |
|
|
| Report Abuse |
|
|
grimm343
|
  |
| Joined: 18 Sep 2008 |
| Total Posts: 2796 |
|
|
| 20 May 2013 08:23 PM |
Sorry. Change the connection line to.. script.Parent.Touched:connect(OnClicked)
And you have to touch it |
|
|
| Report Abuse |
|
|
| |
|
|
| 20 May 2013 08:29 PM |
That script will only work if you touched it. A different event is needed if you want to click it.
script.Parent.ClickDetector.MouseClick:connect() Where you need to add a ClickDetector. |
|
|
| Report Abuse |
|
|
|
| 20 May 2013 08:30 PM |
| I added a Clickdector already |
|
|
| Report Abuse |
|
|
| |
|
|
| 21 May 2013 06:16 AM |
So I got this
function OnClicked() Workspace.P1.Position = Vector3.new(-12.5,6.2,18) end script.Parent.ClickDetector.MouseClick:connect()
Still won't work |
|
|
| Report Abuse |
|
|
| |
|
| |
|