Abandion
|
  |
| Joined: 17 Apr 2010 |
| Total Posts: 4344 |
|
|
| 18 Aug 2016 04:43 PM |
game.Workspace.cannon.Position = game.Workspace.cannonlocator.Position
= has red underline, says "expected identifier, got ="
I am not very good at scripting, can someone explain this to me?
|
|
|
| Report Abuse |
|
|
RoflBread
|
  |
| Joined: 18 Jun 2009 |
| Total Posts: 3803 |
|
|
| 18 Aug 2016 04:46 PM |
| Is that the entire script? That bit looks fine to be assuming you got the names of the objects right. |
|
|
| Report Abuse |
|
|
Abandion
|
  |
| Joined: 17 Apr 2010 |
| Total Posts: 4344 |
|
|
| 18 Aug 2016 04:49 PM |
I changed it a bit since I posted this, now it says " Invalid value for enum Shape" in output
function fire() Instance.new("Part")game.Workspace.Name.cannon game.Workspace.cannon.Shape = Ball game.Workspace.cannon.Position = game.Workspace.cannonlocator.Position end
game.Workspace.button.ClickDetector.Mouseclick: connect(fire) |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 18 Aug 2016 04:49 PM |
workspace.Cannon.CFrame = workspace.CannonLocator.CFrame
|
|
|
| Report Abuse |
|
|
|
| 18 Aug 2016 04:49 PM |
It takes the cannon and places it just above the cannonlocator. If you want it to go onto the exact position do this: game.Workspace.cannon.CFrame = CFrame.new(game.Workspace.cannonlocator.Position)
Borred |
|
|
| Report Abuse |
|
|
|
| 18 Aug 2016 04:50 PM |
Posted before you replied*
Borred |
|
|
| Report Abuse |
|
|
Abandion
|
  |
| Joined: 17 Apr 2010 |
| Total Posts: 4344 |
|
|
| 18 Aug 2016 04:51 PM |
| I set the cannonlocater 1 stud below where I want the cannon to be |
|
|
| Report Abuse |
|
|
Abandion
|
  |
| Joined: 17 Apr 2010 |
| Total Posts: 4344 |
|
|
| 18 Aug 2016 04:52 PM |
The problem seems to be here:
game.Workspace.cannon.Shape = Ball |
|
|
| Report Abuse |
|
|
|
| 18 Aug 2016 04:52 PM |
Shapes are enums, Enum.PartType.Ball
Borred |
|
|
| Report Abuse |
|
|
Abandion
|
  |
| Joined: 17 Apr 2010 |
| Total Posts: 4344 |
|
|
| 18 Aug 2016 04:56 PM |
| Game is still underlined in red |
|
|
| Report Abuse |
|
|
|
| 18 Aug 2016 04:57 PM |
'Ball' Enum.Shape.Ball
part.Shape = insert_shape_here |
|
|
| Report Abuse |
|
|
Abandion
|
  |
| Joined: 17 Apr 2010 |
| Total Posts: 4344 |
|
|
| 21 Aug 2016 04:01 PM |
| Still confused, decided to bump |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
|
| 22 Aug 2016 03:27 AM |
Is There Any Good Programmers That Can Help Me With My Game I Am A Good Programmer But I Need One Or Two More People To Help Me Script My Game Because Sometimes I Take A Whole Week To Find Out How To Fix A Problem With My Game Trust Me I Tried So Many Things For My Current Problem On My Game Which Is Trying To Make A Player On A Permanent Team So When Someone Tries Tries To Be A Type Of Class On My Game My Game Is A Rpg And The Classes Are Knights Archers And Wizards But My Game Is You Pick The Class Every time You Rejoin The Game And My Leader boards And Every Thing Is Messed Up
|
|
|
| Report Abuse |
|
|
|
| 22 Aug 2016 03:37 AM |
| Is There Any Good Programmers That Can Help Me With My Game I Am A Good Programmer But I Need One Or Two More People To Help Me Script My Game Because Sometimes I Take A Whole Week To Find Out How To Fix A Problem With My Game Trust Me I Tried So Many Things For My Current Problem On My Game Which Is Trying To Make A Player On A Permanent Team So When Someone Tries Tries To Be A Type Of Class On My Game My Game Is A Rpg And The Classes Are Knights Archers And Wizards But My Game Is You Pick The Class Every time You Rejoin The Game And My Leader boards And Every Thing Is Messed Up |
|
|
| Report Abuse |
|
|
|
| 22 Aug 2016 04:27 AM |
| --[[try this:]]game.Workspace.cannon.Shape=[[Ball]] |
|
|
| Report Abuse |
|
|
|
| 22 Aug 2016 07:38 AM |
The Velocity represents the direction in which the ball will fly, for example Vector3.new(0,0,0) will launch it upwards
function fire(Velocity) local Ball = Instance.new("Part")game.Workspace.Name.cannon Ball.Shape = Enum.Shape.Ball Ball.Position = game.Workspace.cannonlocator.Position Ball.Velocity = Velocity end
game.Workspace.button.ClickDetector.Mouseclick: connect(fire) |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 22 Aug 2016 07:41 AM |
| Typo, I fixed it 5 seconds later. |
|
|
| Report Abuse |
|
|