Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Homing Missile Function Not Working?

Asked by 3 years ago
local rocket = script.Parent

if rocket.Parent == workspace then
    for i = 1, 50 do
        wait(0.03)
        rocket.Position = rocket.Position + Vector3.new(0, 0.5, 0)
    end
end
local randomPlayer = game.Players:GetPlayers()[math.random(1,#game.Players:GetPlayers())]
print(randomPlayer)
script.Parent:WaitForChild("RocketPropulsion").Target = randomPlayer.Character.HumanoidRootPart
script.Parent:WaitForChild("RocketPropulsion"):fire()
rocket.Touched:Connect(function(hit)
    if hit ~= rocket and not rocket.Parent:FindFirstChild(hit.Name) then
        local explode = Instance.new("Explosion")
        explode.Parent = workspace
        explode.Position = rocket.Position
        rocket:Destroy()
        end
end)

The Start is too make the Missile Move Upwards but after that the line

local randomPlayer = game.Players:GetPlayers()[math.random(1,#game.Players:GetPlayers())]

and after that doesn't run Its also a normal script under the rocket/missile

0
what is the rocked parent? Necro_las 412 — 3y
0
workspace Brockanthony10 19 — 3y

Answer this question