generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Make a torso face a specific object..?

Previous Thread :: Next Thread 
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
09 Jun 2016 12:59 AM
How would I do this for a npc..?
Report Abuse
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
09 Jun 2016 01:02 AM
local g = game.Workspace.Zombies:GetChildren()
for i=1,#g do
if g[i] ~= nil then
if g[i]:FindFirstChild('Torso') ~= nil then

--face the torso to the script.Parent

end
end
end
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
09 Jun 2016 01:02 AM
Torso.CFrame = CFrame.new(Torso.Position, Object.Position)


Report Abuse
Hedr0n is not online. Hedr0n
Joined: 05 Jan 2016
Total Posts: 1524
09 Jun 2016 01:04 AM
CFrame.new(Specific_Object, Npc.Character.HumanoidRootPart.CFrame)
Report Abuse
Flux_Capacitor is not online. Flux_Capacitor
Joined: 07 Apr 2008
Total Posts: 45720
09 Jun 2016 01:07 AM
"CFrame.new(Specific_Object, Npc.Character.HumanoidRootPart.CFrame)"
you're dumb
Report Abuse
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
09 Jun 2016 01:08 AM
for i=1,#g do
if g[i] ~= nil then
if g[i]:FindFirstChild('Torso') ~= nil then
g[i].Torso.CFrame = CFrame.new(g[i].Torso.Position,explosion.Position)
end
end
end

Doesn't work
Report Abuse
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
09 Jun 2016 01:16 AM
b
Report Abuse
Twisted_Christmas is not online. Twisted_Christmas
Joined: 01 Apr 2012
Total Posts: 178
09 Jun 2016 01:40 AM
I dont feel like typing the code, but try to get the magnitude of the nearest object you are looking for, and use BodyGyro.
Report Abuse
Twisted_Christmas is not online. Twisted_Christmas
Joined: 01 Apr 2012
Total Posts: 178
09 Jun 2016 01:43 AM
*just remembered you said for a NPC*
In that case; Do not use BodyGyro, change to C0 for the weld of the torso, and such.
Report Abuse
Briicks is not online. Briicks
Joined: 03 Apr 2015
Total Posts: 1796
09 Jun 2016 02:26 AM
I'm using this right now and it works perfect.

local P = Char:WaitForChild("Torso")
P.CFrame = CFrame.new(P.Position, Vector3.new(workspace.CamToPart.Position.X,P.Position.y,workspace.CamToPart.Position.Z))


Super Fast Profit Finder - https://www.roblox.com/games/421528235/Super-Fast-Profit-Finder
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image