|
| 09 Sep 2011 09:37 AM |
function onClick()
wait()
game.Workspace.TestBrick.BodyThrust.force = +100
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
When i click the button, i want the bodythrust of Testbrick to become greater. But the output tells me there's an unexpected symbol near "+". When i delete the "=" symbol it says "expects "=" near "+"". Which is kinda strange, so any help on how to get this script working would be great. |
|
|
| Report Abuse |
|
|
| |
|
ties
|
  |
| Joined: 12 Nov 2007 |
| Total Posts: 1551 |
|
|
| 09 Sep 2011 09:38 AM |
| I could help you if i would know how to fix it.. But i don't. |
|
|
| Report Abuse |
|
|
| |
|
mopHead
|
  |
| Joined: 13 Mar 2008 |
| Total Posts: 19259 |
|
| |
|
Tiranin
|
  |
| Joined: 03 Apr 2009 |
| Total Posts: 18850 |
|
|
| 09 Sep 2011 09:43 AM |
| game.Workspace.TestBrick.BodyThrust.force = game.Workspace.TestBrick.BodyThrust.force + 100 |
|
|
| Report Abuse |
|
|
gama2xo
|
  |
| Joined: 20 Feb 2016 |
| Total Posts: 10039 |
|
| |
|
|
| 09 Sep 2011 09:46 AM |
i am truely sorry for your lots
Toadwheels12, the undying legacy, only on Roblox. |
|
|
| Report Abuse |
|
|
adrien99
|
  |
| Joined: 01 Aug 2007 |
| Total Posts: 6261 |
|
| |
|
|
| 09 Sep 2011 09:46 AM |
@Tir
It says its attempted to call nil value. |
|
|
| Report Abuse |
|
|
| |
|
|
| 09 Sep 2011 09:53 AM |
See,does he not look dead?
http://www.roblox.com/User.aspx?ID=4088148 |
|
|
| Report Abuse |
|
|
mopHead
|
  |
| Joined: 13 Mar 2008 |
| Total Posts: 19259 |
|
| |
|
| |
|
| |
|
toadjesse
|
  |
| Joined: 03 Jun 2008 |
| Total Posts: 5617 |
|
|
| 09 Sep 2011 10:19 AM |
game.Workspace.TestBrick.BodyThrust.force = game.Workspace.TestBrick.BodyThrust.force + Vector3.new(0,100,0)
This should work |
|
|
| Report Abuse |
|
|
|
| 09 Sep 2011 10:20 AM |
@Toad
OOOOOOOOOOOOOOOOOOOOHHHHHHHHHH
That's what i forgot! xDDD |
|
|
| Report Abuse |
|
|
Gutbomber
|
  |
| Joined: 04 Jul 2009 |
| Total Posts: 944 |
|
|
| 09 Sep 2011 10:20 AM |
| Did you forget to put the ClickDetector in the brick? |
|
|
| Report Abuse |
|
|
Gutbomber
|
  |
| Joined: 04 Jul 2009 |
| Total Posts: 944 |
|
|
| 09 Sep 2011 10:21 AM |
| Oh nvm, toad's code line makes more sense, I just woke up so I gotta refresh my mind. |
|
|
| Report Abuse |
|
|
|
| 09 Sep 2011 10:21 AM |
@Gut
No i forgot the Vector xD |
|
|
| Report Abuse |
|
|
toadjesse
|
  |
| Joined: 03 Jun 2008 |
| Total Posts: 5617 |
|
|
| 09 Sep 2011 10:21 AM |
| So it did work? I guess, the reason why it didn't work is because you just said: +100, it can be everything! and you always need a Vector3.new(0,0,0) if you want to move with a script ;) |
|
|
| Report Abuse |
|
|
|
| 09 Sep 2011 10:23 AM |
@Toad
Wait, it still doesn't work and says the same thing in the output... |
|
|
| Report Abuse |
|
|
toadjesse
|
  |
| Joined: 03 Jun 2008 |
| Total Posts: 5617 |
|
|
| 09 Sep 2011 10:26 AM |
If it still says "a nill ..." then you made a mistake with the Names of the items. A nil value means the thing you wanted to do with, doesn't exist (Mostly wrong name) |
|
|
| Report Abuse |
|
|
Harrokin
|
  |
| Joined: 10 Sep 2008 |
| Total Posts: 8564 |
|
|
| 09 Sep 2011 10:31 AM |
You've connected the event to the "onClicked" function, which doesn't exist. Change the function name from "onClick" to "onClicked". Silly goose. |
|
|
| Report Abuse |
|
|