I have recently made a a script that clones a brick and launches it out of a held item. However the script does not work and it returns with no errors. I really don't know what could be wrong with it, I've double checked to make sure all items are in their proper places, i differentiated between the cloned arrow and the arrow clone, i even spelled 'velocity' correctly.
local tool = script.Parent
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local bullet = game.ReplicatedStorage.bullets.arrow
function pew ()
bullet:clone().Parent = tool
local arrowb = script.Parent.arrow
game.Debris:AddItem(arrowb, 2)
arrowb.CFrame = tool.Handle.Cframe
arrowb.CFrame = CFrame.new(arrowb.Position,mouse.Hit.P)
local v = Instance.new ("BodyVelocity", arrowb)
v.velocity = arrowb.CFrame.lookVector *90
v.maxForce = Vector3.new(math.huge, math.huge, math.huge)
end
tool.Activated:connect(pew)
Any ideas what could be wrong?
