--In this script is a series of defined variables --There are a lot of these variables and to keep things short and sweet I've omitted them from ------this question
Any help is much appreciated thanks guys
01 | local function Start() |
02 | local Dart = Instance.new( 'Part' ) do |
03 | -- Set up the dart part |
04 | Dart.Name = 'Dart' |
05 | Dart.FormFactor = Enum.FormFactor.Custom --NOTE: This must be done before changing Size |
06 | Dart.Size = dartsize |
07 | Dart.CanCollide = false |
08 | -- Add the mesh |
09 | local mesh = Instance.new( 'SpecialMesh' , Dart) |
10 | mesh.MeshId = dartmesh |
11 | mesh.Scale = meshscale |
12 | -- Add a force to counteract gravity |
13 | local bodyForce = Instance.new( 'BodyForce' , Dart) |
14 | bodyForce.Name = 'Antigravity' |
15 | bodyForce.force = Vector 3. new( 0 , Dart:GetMass() * Gravity, 0 ) |
put a end on line 18 with a end)
so it would be like
01 | local function Start() |
02 | local Dart = Instance.new( 'Part' ) do |
03 | -- Set up the dart part |
04 | Dart.Name = 'Dart' |
05 | Dart.FormFactor = Enum.FormFactor.Custom --NOTE: This must be done before changing Size |
06 | Dart.Size = dartsize |
07 | Dart.CanCollide = false |
08 | -- Add the mesh |
09 | local mesh = Instance.new( 'SpecialMesh' , Dart) |
10 | mesh.MeshId = dartmesh |
11 | mesh.Scale = meshscale |
12 | -- Add a force to counteract gravity |
13 | local bodyForce = Instance.new( 'BodyForce' , Dart) |
14 | bodyForce.Name = 'Antigravity' |
15 | bodyForce.force = Vector 3. new( 0 , Dart:GetMass() * Gravity, 0 ) |
put an end at line 18
Solution: I put end at line 18 and it solved the initial issue. Thanks @newton162 and @AlbertoMiAmigo2.
Note: The issue was actually some misplaced variables.