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

How do I go about scripting a homing missile's target?

Asked by 5 years ago
Edited 5 years ago

Hello, first posting here. I'm making a 3-D Megaman like game where you fight bosses with specialized attacks, such as shooting you with a projectile. In my game you face off with a Boss at the end of the level with a custom rigged model, much like the player. In coding his attack pattern, Im in the process of making pre-made rocket and changing the position of it to wherever the Bosses arm is. The only problem comes whenever I need to define a target for the projectile to home in on.

wait(5)
local target = game.Workspace.creamsodacrusader.Chestpiece.Core
script.Parent.RocketPropulsion.Target = target
script.Parent.RocketPropulsion:Fire()

How do I make it so it targets any player's "Core" part, since it is unique to the custom rig?

Thanks.

1
make a loop so the target is the characters humanoidrootpart Imperialy 149 — 5y
0
How would I reference that, though? Using game.Players.LocalPlayer.Character.whatever always returns an error in the output saying LocalPlayer is nil krankycaat 11 — 5y
0
put the line repeat wait() until game.Players.LocalPlayer.Character before game.Players.LocalPlayer.Character.whatever 0_Halloween 166 — 5y
0
and also use WaitForChild("child here"), game.Players.LocalPlayer.Character:WaitForChild("whatever") 0_Halloween 166 — 5y
0
I couldn't exactly get it to work as you intended, but I found a workaround, it being to change the name of the player's model to whatever the custom one is. Thanks. krankycaat 11 — 5y

Answer this question