-- June 30, 2019
-- Made by IiNaoriku
--put this in StarterPlayerScripts
local rs = game:GetService("ReplicatedStorage")
local gunEvent = rs:WaitForChild("GunEvent")
gunEvent.OnServerEvent:Connect(function(player, startPos, endPos)
local part = Instance.new("Part")
local specialMesh = Instance.new("SpecialMesh", part)
specialMesh.MeshType = Enum.MeshType.Sphere
specialMesh.Scale = Vector3.new(0.1,0.25,4)
part.Material = Enum.Material.Neon
part.CFrame = CFrame.new(startPos, endPos)
local bv = Instance.new("BodyVelocity", part)
bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
bv.Velocity = part.CFrame.LookVector * 1
part.Parent = game.Workspace.CurrentCamera
part.CanCollide = false
part.BrickColor = BrickColor.new("New Yeller")
delay(5, function()
part:Destroy()
end)
end)
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.

1 comment
The problem is on line 15, i have to use scale because its a mesh