Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

I have an error that ive never seen before and I dont understand it??

Asked by 5 years ago
Edited 5 years ago
-- 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 answer

Log in to vote
0
Answered by 5 years ago

Maybe try using .Size not .Scale?

0
The problem is on line 15, i have to use scale because its a mesh iinaoriku 52 — 5y
Ad

Answer this question