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: can someone please explain this script?

Previous Thread :: Next Thread 
RubyEpicDragon is not online. RubyEpicDragon
Joined: 02 May 2015
Total Posts: 1211
17 Jan 2017 10:08 AM
It is a foot panting script but i need explaination for what does what and how.

wait(1)
User = game.Players.LocalPlayer
Humanoid = User.Character.Humanoid
Torso = User.Character.Torso
L_Hip = Torso["Left Hip"]
R_Hip = Torso["Right Hip"]

function ArcTan(x, y)
r = math.atan(y / x)
if x < 0 then
r = r + math.pi
end
return r
end

vel = Vector3.new()
while true do
wait()
if Torso.Velocity.magnitude > 1 then
m = (vel - Torso.Velocity).magnitude / Humanoid.WalkSpeed
vel = (Torso.Velocity * m + vel * 2) / (m + 2)
v = Torso.CFrame:pointToObjectSpace(vel + Torso.Position)
L_a = ArcTan(v.x, -v.z)
R_a = 3.1416 - ArcTan(v.x, v.z)
L_Hip.C1 = CFrame.new(0, 1, 0)*CFrame.Angles(0, R_a, 0)
R_Hip.C1 = CFrame.new(0, 1, 0)*CFrame.Angles(0, L_a, 0)
L_Hip.C0 = CFrame.new(-0.5, -1, 0)*CFrame.Angles(0, R_a, 0)
R_Hip.C0 = CFrame.new(0.5, -1, 0)*CFrame.Angles(0, L_a, 0)
L_Hip.MaxVelocity = Torso.Velocity.magnitude / 100
R_Hip.MaxVelocity = Torso.Velocity.magnitude / 100
else
L_Hip.C1 = CFrame.new(0, 1, 0)*CFrame.Angles(0, -1.57, 0)
R_Hip.C1 = CFrame.new(0, 1, 0)*CFrame.Angles(0, 1.57, 0)
L_Hip.C0 = CFrame.new(-0.5, -1, 0)*CFrame.Angles(0, -1.57, 0)
R_Hip.C0 = CFrame.new(0.5, -1, 0)*CFrame.Angles(0, 1.57, 0)
end
end

.
Report Abuse
pketny is not online. pketny
Joined: 27 Dec 2010
Total Posts: 1162
17 Jan 2017 10:44 AM
It uses CFrame to calculate some angles

http://wiki.roblox.com/index.php?title=CFrame

http://wiki.roblox.com/index.php?title=Understanding_CFrame
Report Abuse
RubyEpicDragon is not online. RubyEpicDragon
Joined: 02 May 2015
Total Posts: 1211
17 Jan 2017 11:32 AM
and what is the velocity and math.atan stuff about?
Report Abuse
BIueNarwhaI is not online. BIueNarwhaI
Joined: 10 Apr 2012
Total Posts: 866
17 Jan 2017 11:34 AM
It's calculating the value of arctan(y / x)


Report Abuse
pketny is not online. pketny
Joined: 27 Dec 2010
Total Posts: 1162
17 Jan 2017 11:34 AM
Velocity is the speed of the basepart, the script is using that to determine the angles created later.

the math.atan is also used for calculating angles, it's all just math you get in your math lessons
Report Abuse
RubyEpicDragon is not online. RubyEpicDragon
Joined: 02 May 2015
Total Posts: 1211
17 Jan 2017 11:37 AM
does this use inverse kinematics?
Report Abuse
RubyEpicDragon is not online. RubyEpicDragon
Joined: 02 May 2015
Total Posts: 1211
17 Jan 2017 11:38 AM
what is the vel and m thingy?
Report Abuse
RubyEpicDragon is not online. RubyEpicDragon
Joined: 02 May 2015
Total Posts: 1211
17 Jan 2017 11:39 AM
this is like lua.spaghetti to me. .-.
Report Abuse
BIueNarwhaI is not online. BIueNarwhaI
Joined: 10 Apr 2012
Total Posts: 866
17 Jan 2017 11:41 AM
It's mostly just trignometry.

the m, vel and v equations look familiar to me but it's been so long since I did any mechanics e.e


Report Abuse
RubyEpicDragon is not online. RubyEpicDragon
Joined: 02 May 2015
Total Posts: 1211
17 Jan 2017 12:03 PM
ok but this whole script is about foot planting, and how does the part works where they check where the player is moving to?
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