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

Unable to cast coordinate frame?

Asked by 5 years ago
Edited 5 years ago
while wait()do
    local ammo = script.Ammo
    local mousePosition = script.MousePosition
    wait(.5)
    if script.Ammo.Value > 0 then
        local bullet = Instance.new("Part", workspace)
        bullet.Size = Vector3.new(4, 0.05, 0.05)
        bullet.Anchored = true
        local plr = script.Parent.Parent.Parent.Name
        bullet.Orientation = script.Parent.MainShootPart.Orientation
        bullet.Position = script.Parent.MainShootPart.Position
        local CFrame1 = bullet.CFrame
        local CFrame2 = script.MousePosition

        for i = 0,100,1 do
            bullet.CFrame = CFrame1:lerp(CFrame2,i/200)
            wait()
        end
    end
end
0
Could you give more description on this, like which line it says the error, and go more in depth? Lugical 425 — 5y
0
What is `script.MousePosition`? If it's a CFrameValue you'll have to take the actual Value of it. jakedies 315 — 5y

Answer this question