So I made a gun that uses Instance.new() The problem Is the bullet not going foward
SCRIPT:
local tool = script.Parent local debounce = false tool.Activated:Connect(function() if debounce == false then debounce = true local newBullet = Instance.new("Part") local Thrust = Instance.new("VectorForce") local Attachment = Instance.new("Attachment") newBullet.Parent = game.Workspace Thrust.Parent = newBullet Attachment.Parent = newBullet newBullet.Size = Vector3.new(1,1,1) Thrust.Force = Vector3.new(10000,300,0) newBullet.BrickColor = BrickColor.Yellow() newBullet.Anchored = false newBullet.Position = script.Parent.Launcher.Position newBullet.Orientation = script.Parent.Launcher.Orientation newBullet.Touched:Connect(function(hit) local humanoid = hit.Parent:WaitForChild("Humanoid") if humanoid then humanoid:TakeDamage(100) end end) wait(3) newBullet:Destroy() debounce = false end end)
Hey, it's me again. TheVectorForce
Attachment0
property was never set, it's basically where the thrust is exerted, you added the attachment to the part but never set the property on the Vector Force
. Just add this after Attachment was declared, Thrust.Attachment0 = Attachment
. I hope this helped. Good Luck!