I have an error that ive never seen before and I dont understand it??
Asked by
5 years ago Edited 5 years ago
04 | local rs = game:GetService( "ReplicatedStorage" ) |
05 | local gunEvent = rs:WaitForChild( "GunEvent" ) |
07 | gunEvent.OnServerEvent:Connect( function (player, startPos, endPos) |
09 | local part = Instance.new( "Part" ) |
10 | local specialMesh = Instance.new( "SpecialMesh" , part) |
11 | specialMesh.MeshType = Enum.MeshType.Sphere |
13 | specialMesh.Scale = Vector 3. new( 0.1 , 0.25 , 4 ) |
14 | part.Material = Enum.Material.Neon |
15 | part.CFrame = CFrame.new(startPos, endPos) |
17 | local bv = Instance.new( "BodyVelocity" , part) |
18 | bv.MaxForce = Vector 3. new( math.huge , math.huge , math.huge ) |
19 | bv.Velocity = part.CFrame.LookVector * 1 |
21 | part.Parent = game.Workspace.CurrentCamera |
22 | part.CanCollide = false |
24 | part.BrickColor = BrickColor.new( "New Yeller" ) |
I made a bullet generating code, but it gives me this weird error that I've never seen before. This is the error,
12:16:35.207 - ServerScriptService.bullet:15: bad argument #1 to 'new' (Vector3 expected, got Object)
12:16:35.208 - Stack Begin
12:16:35.208 - Script 'ServerScriptService.bullet', Line 15
Can someone help me with this? Thanks.