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

(?) "Bullet is not a valid member of CFrame"

Asked by 6 years ago

I am trying to make it fire a projectile with this script

local player = game.Players.LocalPlayer local tool = script.Parent local Char = player.Character

function GetBullet() local Bullet = Instance.new("Part",workspace) Bullet.FormFactor = "Custom" Bullet.Size = Vector3.new(1,1,1) Bullet.BrickColor = BrickColor.new("Purple") Bullet.CanCollide = false Instance.new("BodyVelocity",Bullet) return Bullet

end

tool.Equipped:Connect(function(mouse) mouse.Button1Down:connect(function() local mH = mouse.hit local Bullet = GetBullet() Bullet.CFrame = tool.Handle.CFrame * CFrame.new(Char.UpperTorso.CFrame.lookVector * 2) Bullet.CFrame = CFrame.new(Bullet.Position, mH.Bullet) Bullet.BodyVelocity.velocity = Bullet.CFrame.lookVector * 120 --Speed Of Bullet Bullet.Touched:connect(function(hit) local humanoid = hit.Parent:FindFirstChild("Humanoid") if humanoid then humanoid:TakeDamage(50) end end)
end)
end)

It says "Bullet is not a valid Member of CFrame"

0
Can you use lua blocks instead of text blocks? It's all minified... brokenVectors 525 — 6y

1 answer

Log in to vote
0
Answered by 5 years ago

bullet should be a valid member of cframe

Ad

Answer this question