Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Bullet doesn't move for some reason?

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)

1 answer

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!

2 comments

0

Oooooh I forgot! Thank you!

0

I'm glad it worked! If so please mark it as the answer, thank you!

This discussion is preserved as it was. New answers, comments, and votes are closed.