Homing Missile Function Not Working?
01 | local rocket = script.Parent |
03 | if rocket.Parent = = workspace then |
06 | rocket.Position = rocket.Position + Vector 3. new( 0 , 0.5 , 0 ) |
09 | local randomPlayer = game.Players:GetPlayers() [ math.random( 1 ,#game.Players:GetPlayers()) ] |
11 | script.Parent:WaitForChild( "RocketPropulsion" ).Target = randomPlayer.Character.HumanoidRootPart |
12 | script.Parent:WaitForChild( "RocketPropulsion" ):fire() |
13 | rocket.Touched:Connect( function (hit) |
14 | if hit ~ = rocket and not rocket.Parent:FindFirstChild(hit.Name) then |
15 | local explode = Instance.new( "Explosion" ) |
16 | explode.Parent = workspace |
17 | explode.Position = rocket.Position |
The Start is too make the Missile Move Upwards but after that the line
1 | 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