Hi, I've been trying to make a fireball that when you click it fires but I can't seem to figure out a method that works. I need RocketPropulsion to go towards the mouse positon but RocketPropulsion requires an object as a target. I want the fireball just to keep flying until it reaches an object and it gets destroyed. Thanks!

Edit: I have tried

player = game.Players.LocalPlayer
mouse = player:GetMouse()
hit = false
life = 10

script.Parent.Activated:Connect(function()
	fireball = Instance.new("Part", game.Workspace)
	fireball.Size = Vector3.new(0.5, 0.5, 0.5)
	fireball.Color = Color3.fromRGB(255, 0, 0)
	fireball.Material = Enum.Material.Grass
	local fire = Instance.new("Fire", fireball)
	fire.Size = 5
	fire.Heat = 10
	local target = Instance.new("Part", game.Workspace)
	target.Position = mouse.Hit.p
	target.Transparency = 1
	local rocket = Instance.new("RocketPropulsion", fireball)
	rocket.Target = target
	rocket:Fire()
	while hit == false and life ~= 0 do
		life = life - 1
		wait(1)
	end
	fireball:Destroy()
end)

fireball.Touched:Connect(function(touch)
	hit = true
end)

5 comments

0

you can see a sample from free models and learn how it was coded.

0

That doesn't answer my question...

0

alright post your attempted code then

0

edited

0

Just use a BodyVelocity with the Velocity equaling the lookVector of Mouse.Hit * speed multiplier