How can my i make a directional amo?

what do you want ?
make the player orientation choose the direction of the amo

script: local script
script localisation: starterpack (Tool)

here’s the script:

local Players = game:GetService("Players")
local db = false

local plr = Players.LocalPlayer
local mouse = plr:GetMouse()

local tool = script.Parent
print("1")
tool.Equipped:Connect(function()
	print("2")
	mouse.Button1Up:Connect(function()
		if db == false then
			print("3")
			local Balle = Instance.new("Part", workspace)
			Balle.Name = "Balle"
			Balle.Color = Color3.fromRGB(251, 255, 0)
			Balle.Material = Enum.Material.Neon
			Balle.Anchored = true
			Balle.Size = Vector3.new(0.265, 1.15, 0.25)
			Balle.Rotation = Vector3.new(0, 90, 0)
			Balle.Position = tool.Handle.Position
			local HL = Instance.new("Highlight", Balle)
			HL.OutlineColor = Color3.fromRGB(0, 0, 0)
			HL.OutlineTransparency = 0
			db = true
			while true do
				wait()
				Balle.Position += Vector3.new(0, 0, -50)
				db = false
			end
		end
	end)
end)

Hi! Try this

local Players = game:GetService("Players")
local db = false

local plr = Players.LocalPlayer
local mouse = plr:GetMouse()

local tool:Tool = script.Parent
local equipped = false

tool.Equipped:Connect(function()
	equipped = true
end)

tool.Unequipped:Connect(function()
	equipped = false
end)

mouse.Button1Up:Connect(function()
	if equipped and not db then
		local Balle = Instance.new("Part", workspace)
		Balle.Name = "Balle"
		Balle.Color = Color3.fromRGB(251, 255, 0)
		Balle.Material = Enum.Material.Neon
		Balle.Anchored = false
		Balle.CanCollide = false
		Balle.CFrame = tool.Handle.CFrame
		local HL = Instance.new("Highlight", Balle)
		HL.OutlineColor = Color3.fromRGB(0, 0, 0)
		HL.OutlineTransparency = 0
		db = true
		local bodyVelocity = Instance.new("BodyVelocity", Balle)
		bodyVelocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
		bodyVelocity.Velocity = Balle.CFrame.LookVector*100
		
		game.Debris:AddItem(Balle, 5) -- After 5 seconds Balle will destroy
		
		wait(5)
		
		db = false
	end
end)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.