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

Advanced please Help?

Asked by 10 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

Okay this script is supposed to be for a hockey goalie, it works but it only follows the puck when its in workspace how can I make sure it follows the object at all times? So when the hockey stick touches the it makes it a part of the stick (tool) how can I fix the script below to make it follow it even when its in the tool? Thanks and I know this is kind of a request even though you aren't supposed to requests i'm sorry Script Helpers I just wanted this to be answered

while true do -- while true do function
BP = script.Parent.BodyPosition -- variable to its bodyposition
P0 = script.Parent.Position -- variable to its torso position
P1 = game.Workspace:WaitForChild("Puck").Position -- variable to the object it needs to follow
P2 = game.Workspace.Netss.LeftPost.Position -- variable to its left post of the net
P3 = game.Workspace.Netss.RightPost.Position -- variable to its right post of the net
if (P1.x < P2.x) and (P1.x > P3.x) then -- checks if they exists
BP.position = Vector3.new(P1.x, P0.y, P0.z) -- makes the goalie follow the puck only when its in workspacce
end
wait()
end

Answer me here and ask questions on roblox @DevScripting Thank you!

Answer this question