Advertisement
StarzoZero

Roblox FE Script Template (For Script Beginners)

Dec 30th, 2018
689
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.04 KB | None | 0 0
  1. if game:GetService("RunService"):IsClient()then error("Please run as a server script. Use h/ instead of hl/.")end;print("FE Compatibility: by WaverlyCole");InternalData = {}
  2. do
  3. script.Parent = owner.Character
  4. local Event = Instance.new("RemoteEvent");Event.Name = "UserInput"
  5. local function NewFakeEvent()
  6. local Bind = Instance.new("BindableEvent")
  7. local Fake;Fake = {Connections = {},
  8. fakeEvent=true;
  9. Connect=function(self,Func)
  10. Bind.Event:connect(Func)
  11. self.Connections[Bind] = true
  12. return setmetatable({Connected = true},{
  13. __index = function (self,Index)
  14. if Index:lower() == "disconnect" then
  15. return function() Fake.Connections[Bind] = false;self.Connected = false end
  16. end
  17. return Fake[Index]
  18. end;
  19. __tostring = function() return "Connection" end;
  20. })
  21. end}
  22. Fake.connect = Fake.Connect;return Fake;
  23. end
  24. local Mouse = {Target=nil,Hit=CFrame.new(),KeyUp=NewFakeEvent(),KeyDown=NewFakeEvent(),Button1Up=NewFakeEvent(),Button1Down=NewFakeEvent()}
  25. local UserInputService = {InputBegan=NewFakeEvent(),InputEnded=NewFakeEvent()}
  26. local ContextActionService = {Actions={},BindAction = function(self,actionName,Func,touch,...)
  27. self.Actions[actionName] = Func and {Name=actionName,Function=Func,Keys={...}} or nil
  28. end};ContextActionService.UnBindAction = ContextActionService.BindAction
  29. local function TriggerEvent(self,Event,...)
  30. local Trigger = Mouse[Event]
  31. if Trigger and Trigger.fakeEvent and Trigger.Connections then
  32. for Connection,Active in pairs(Trigger.Connections) do if Active then Connection:Fire(...) end end
  33. end
  34. end
  35. Mouse.TrigEvent = TriggerEvent;UserInputService.TrigEvent = TriggerEvent
  36. Event.OnServerEvent:Connect(function(FiredBy,Input)
  37. if FiredBy.Name ~= owner.Name then return end
  38. if Input.MouseEvent then
  39. Mouse.Target = Input.Target;Mouse.Hit = Input.Hit
  40. else
  41. local Begin = Input.UserInputState == Enum.UserInputState.Begin
  42. if Input.UserInputType == Enum.UserInputType.MouseButton1 then return Mouse:TrigEvent(Begin and "Button1Down" or "Button1Up") end
  43. for _,Action in pairs(ContextActionService.Actions) do
  44. for _,Key in pairs(Action.Keys) do if Key==Input.KeyCode then Action.Function(Action.Name,Input.UserInputState,Input) end end
  45. end
  46. Mouse:TrigEvent(Begin and "KeyDown" or "KeyUp",Input.KeyCode.Name:lower())
  47. UserInputService:TrigEvent(Begin and "InputBegan" or "InputEnded",Input,false)
  48. end
  49. end)
  50. InternalData["Mouse"] = Mouse;InternalData["ContextActionService"] = ContextActionService;InternalData["UserInputService"] = UserInputService
  51. Event.Parent = NLS([[
  52. local Player = owner;local Event = script:WaitForChild("UserInput");local UserInputService = game:GetService("UserInputService");local Mouse = Player:GetMouse()
  53. local Input = function(Input,gameProcessedEvent)
  54. if gameProcessedEvent then return end
  55. Event:FireServer({KeyCode=Input.KeyCode,UserInputType=Input.UserInputType,UserInputState=Input.UserInputState})
  56. end
  57. UserInputService.InputBegan:Connect(Input);UserInputService.InputEnded:Connect(Input)
  58. local Hit,Target
  59. while wait(1/30) do
  60. if Hit ~= Mouse.Hit or Target ~= Mouse.Target then
  61. Hit,Target = Mouse.Hit,Mouse.Target;Event:FireServer({["MouseEvent"]=true,["Target"]=Target,["Hit"]=Hit})
  62. end
  63. end
  64. ]],owner.Character)
  65. end
  66. RealGame = game;game = setmetatable({},{
  67. __index = function (self,Index)
  68. local Sandbox = function (Thing)
  69. if Thing:IsA("Player") then
  70. local RealPlayer = Thing
  71. return setmetatable({},{
  72. __index = function (self,Index)
  73. local Type = type(RealPlayer[Index])
  74. if Type == "function" then
  75. if Index:lower() == "getmouse" or Index:lower() == "mouse" then
  76. return function (self)return InternalData["Mouse"] end
  77. end
  78. return function (self,...)return RealPlayer[Index](RealPlayer,...) end
  79. end
  80. return RealPlayer[Index]
  81. end;
  82. __tostring = function(self) return RealPlayer.Name end
  83. })
  84. end
  85. end
  86. if RealGame[Index] then
  87. local Type = type(RealGame[Index])
  88. if Type == "function" then
  89. if Index:lower() == "getservice" or Index:lower() == "service" then
  90. return function (self,Service)
  91. local FakeServices = {
  92. ["players"] = function()
  93. return setmetatable({},{
  94. __index = function (self2,Index2)
  95. local RealService = RealGame:GetService(Service)
  96. local Type2 = type(Index2)
  97. if Type2 == "function" then
  98. return function (self,...) return RealService[Index2](RealService,...)end
  99. else
  100. if Index2:lower() == "localplayer" then return Sandbox(owner) end
  101. return RealService[Index2]
  102. end
  103. end;
  104. __tostring = function(self) return RealGame:GetService(Service).Name end
  105. })
  106. end;
  107. ["contextactionservice"] = function() return InternalData["ContextActionService"] end;
  108. ["userinputservice"] = function() return InternalData["UserInputService"] end;
  109. ["runservice"] = function()
  110. return setmetatable({},{
  111. __index = function(self2,Index2)
  112. local RealService = RealGame:GetService(Service)
  113. local Type2 = type(Index2)
  114. if Type2 == "function" then
  115. return function (self,...) return RealService[Index2](RealService,...) end
  116. else
  117. local RunServices = {
  118. ["bindtorenderstep"] = function() return function (self,Name,Priority,Function) return RealGame:GetService("RunService").Stepped:Connect(Function) end end;
  119. ["renderstepped"] = function() return RealService["Stepped"] end
  120. }
  121. if RunServices[Index2:lower()] then return RunServices[Index2:lower()]() end
  122. return RealService[Index2]
  123. end
  124. end
  125. })
  126. end
  127. }
  128. if FakeServices[Service:lower()] then return FakeServices[Service:lower()]() end
  129. return RealGame:GetService(Service)
  130. end
  131. end
  132. return function (self,...) return RealGame[Index](RealGame,...) end
  133. else
  134. if game:GetService(Index) then return game:GetService(Index) end
  135. return RealGame[Index]
  136. end
  137. end
  138. return nil
  139. end
  140. });Game = game;owner = game:GetService("Players").LocalPlayer;script = Instance.new("Script");print("Complete! Running...")
  141.  
  142. local Player, Character, Mouse = game:service("Players").LocalPlayer, game:GetService("Players").LocalPlayer.Character, game:GetService("Players").LocalPlayer:GetMouse();
  143. local Torso = Character:FindFirstChild("Torso")
  144. local rootPart = Character:FindFirstChild("HumanoidRootPart")
  145. local Humanoid = Character:FindFirstChild("Humanoid")
  146. local Head = Character:FindFirstChild("Head")
  147. local Right_Arm = Character:FindFirstChild("Right Arm")
  148. local Left_Arm = Character:FindFirstChild("Left Arm")
  149. local Right_Leg = Character:FindFirstChild("Right Leg")
  150. local Left_Leg = Character:FindFirstChild("Left Leg")
  151. local Right_Shoulder = Torso:FindFirstChild("Right Shoulder")
  152. local Left_Shoulder = Torso:FindFirstChild("Left Shoulder")
  153. local Right_Hip = Torso:FindFirstChild("Right Hip")
  154. local Left_Hip = Torso:FindFirstChild("Left Hip")
  155. local Neck = Torso:FindFirstChild("Neck")
  156. local rootPart = Character:FindFirstChild("HumanoidRootPart")
  157. local rootJoint = rootPart:FindFirstChild("RootJoint")
  158. local CurrentIdle = "Idling1"
  159. local Degree = 0.0175438596491228
  160. local canremove = false
  161. local debounce = false
  162. local UIService=game:GetService'UserInputService'
  163. _G.SongName = math.random(1,9025232)
  164. sin = math.sin
  165. Right_Leg.FormFactor = "Custom";
  166. Left_Leg.FormFactor = "Custom";
  167. rootPart.Archivable = true;
  168. rootJoint.Archivable = true;
  169. c_new = CFrame.new;
  170. c_angles = CFrame.Angles;
  171. i_new = Instance.new
  172. Humanoid:ClearAllChildren();
  173. local isAttacking = false
  174. local isSprinting = false
  175. local Animations = false
  176. local Angle = 0
  177. local Axis = 0
  178. local angleSpeed = 1
  179. local axisSpeed = angleSpeed
  180. local currentAnim
  181. local levetatingheight = 3
  182. local WalkType = "Ground"
  183.  
  184. function Sound(parent,loop,vol,id)
  185. local s = Instance.new('Sound',parent)
  186. s.Looped = loop
  187. s.Volume = vol
  188. s.MaxDistance=200
  189. s.EmitterSize=20
  190. s.SoundId = 'rbxassetid://'..tostring(id)
  191. s:Play()
  192. if loop == false then
  193. wait(s.TimeLength)
  194. s:Destroy()
  195. end
  196. end
  197.  
  198. Sound(rootPart,true,1,146309999)
  199.  
  200. newWeld = function(wp0, wp1, wc0x, wc0y, wc0z)
  201. wld = Instance.new("Weld", wp1)
  202. wld.Part0 = wp0
  203. wld.Part1 = wp1
  204. wld.C0 = CFrame.new(wc0x, wc0y, wc0z)
  205. return wld
  206. end
  207.  
  208. function noOutline(part)
  209. part.TopSurface, part.BottomSurface, part.LeftSurface, part.RightSurface, part.FrontSurface, part.BackSurface = 10, 10, 10, 10, 10, 10
  210. end
  211.  
  212. local function Part(Name,Color, Material, Transparency,Shape, Size, CFrame,CanCollide,Anchored,parent)
  213. local partie = i_new("Part",parent)
  214. partie.Name=Name
  215. partie.BrickColor = BrickColor.new(Color)
  216. partie.Material = Material
  217. partie.Shape = Shape
  218. partie.Transparency = Transparency
  219. partie.Size = Size
  220. partie.CFrame = CFrame
  221. partie.CanCollide = CanCollide
  222. partie.Anchored = Anchored
  223. return partie
  224. end
  225.  
  226.  
  227.  
  228. function swait(num)
  229. if num == 0 or num == nil then
  230. game:GetService("RunService").Stepped:wait(0)
  231. else
  232. for i = 0, num do
  233. game:GetService("RunService").Stepped:wait(0)
  234. end
  235. end
  236. end
  237.  
  238. function mesh(Mesh, part, meshtype, meshid, offset, scale)
  239. local mesh = i_new(Mesh)
  240. mesh.Parent = part
  241. if Mesh == "SpecialMesh" then
  242. mesh.MeshType = meshtype
  243. mesh.MeshId = meshid
  244. end
  245. mesh.Offset = offset
  246. mesh.Scale = scale
  247. return mesh
  248. end
  249.  
  250. function rayCast(Pos, Dir, Max, Ignore) -- Origin Position, Direction, MaxDistance, IgnoreDescendants
  251. return game:GetService("Workspace"):FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999.999)), Ignore)
  252. end
  253.  
  254. function QuaternionFromCFrame(cf)
  255. local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
  256. local trace = m00 + m11 + m22
  257. if trace > 0 then
  258. local s = math.sqrt(1 + trace)
  259. local recip = 0.5/s
  260. return (m21-m12)*recip, (m02-m20)*recip, (m10-m01)*recip, s*0.5
  261. else
  262. local i = 0
  263. if m11 > m00 then
  264. i = 1
  265. end
  266. if m22 > (i == 0 and m00 or m11) then
  267. i = 2
  268. end
  269. if i == 0 then
  270. local s = math.sqrt(m00-m11-m22+1)
  271. local recip = 0.5/s
  272. return 0.5*s, (m10+m01)*recip, (m20+m02)*recip, (m21-m12)*recip
  273. elseif i == 1 then
  274. local s = math.sqrt(m11-m22-m00+1)
  275. local recip = 0.5/s
  276. return (m01+m10)*recip, 0.5*s, (m21+m12)*recip, (m02-m20)*recip
  277. elseif i == 2 then
  278. local s = math.sqrt(m22-m00-m11+1)
  279. local recip = 0.5/s return (m02+m20)*recip, (m12+m21)*recip, 0.5*s, (m10-m01)*recip
  280. end
  281. end
  282. end
  283.  
  284. function QuaternionToCFrame(px, py, pz, x, y, z, w)
  285. local xs, ys, zs = x + x, y + y, z + z
  286. local wx, wy, wz = w*xs, w*ys, w*zs
  287. local xx = x*xs
  288. local xy = x*ys
  289. local xz = x*zs
  290. local yy = y*ys
  291. local yz = y*zs
  292. local zz = z*zs
  293. return CFrame.new(px, py, pz,1-(yy+zz), xy - wz, xz + wy,xy + wz, 1-(xx+zz), yz - wx, xz - wy, yz + wx, 1-(xx+yy))
  294. end
  295.  
  296. function QuaternionSlerp(a, b, t)
  297. local cosTheta = a[1]*b[1] + a[2]*b[2] + a[3]*b[3] + a[4]*b[4]
  298. local startInterp, finishInterp;
  299. if cosTheta >= 0.0001 then
  300. if (1 - cosTheta) > 0.0001 then
  301. local theta = math.acos(cosTheta)
  302. local invSinTheta = 1/math.sin(theta)
  303. startInterp = math.sin((1-t)*theta)*invSinTheta
  304. finishInterp = math.sin(t*theta)*invSinTheta
  305. else
  306. startInterp = 1-t
  307. finishInterp = t
  308. end
  309. else
  310. if (1+cosTheta) > 0.0001 then
  311. local theta = math.acos(-cosTheta)
  312. local invSinTheta = 1/math.sin(theta)
  313. startInterp = math.sin((t-1)*theta)*invSinTheta
  314. finishInterp = math.sin(t*theta)*invSinTheta
  315. else
  316. startInterp = t-1
  317. finishInterp = t
  318. end
  319. end
  320. return a[1]*startInterp + b[1]*finishInterp, a[2]*startInterp + b[2]*finishInterp, a[3]*startInterp + b[3]*finishInterp, a[4]*startInterp + b[4]*finishInterp
  321. end
  322.  
  323. function clerp(a, b, t)
  324. local qa = {QuaternionFromCFrame(a)}
  325. local qb = {QuaternionFromCFrame(b)}
  326. local ax, ay, az = a.x, a.y, a.z
  327. local bx, by, bz = b.x, b.y, b.z
  328. local _t = 1-t
  329. return QuaternionToCFrame(_t*ax + t*bx, _t*ay + t*by, _t*az + t*bz,QuaternionSlerp(qa, qb, t))
  330. end
  331.  
  332. swait()
  333. LA_Weld = newWeld(Torso, Left_Arm, -1.5, 0.5, 0)
  334. Left_Arm.Weld.C1 = CFrame.new(0, 0.5, 0)
  335. RA_Weld = newWeld(Torso, Right_Arm, 1.5, 0.5, 0)
  336. Right_Arm.Weld.C1 = CFrame.new(0, 0.5, 0)
  337. LL_Weld = newWeld(Torso, Left_Leg, -0.5, -1, 0)
  338. Left_Leg.Weld.C1 = CFrame.new(0, 1, 0) -- Left_Leg.Weld.C1 = CFrame.new(0, 1, 0.15)
  339. RL_Weld = newWeld(Torso, Right_Leg, 0.5, -1, 0)
  340. Right_Leg.Weld.C1 = CFrame.new(0, 1, 0) -- Right_Leg.Weld.C1 = CFrame.new(0, 1, 0.15)
  341. Torso_Weld = newWeld(rootPart, Torso, 0, -1, 0)
  342. Torso.Weld.C1 = CFrame.new(0, -1, 0)
  343. Head_Weld = newWeld(Torso, Head, 0, 1.5, 0)
  344.  
  345. for i,v in pairs(Character:GetChildren()) do
  346. if v:IsA('Accoutrement') or v:IsA('Shirt') or v:IsA('Pants') then
  347. v:Destroy()
  348. elseif v:IsA('Part') and v.Name=='Head' then
  349. v.face:Destroy()
  350. end
  351. end
  352.  
  353. Character['Body Colors'].HeadColor=BrickColor.new('Really black')
  354. Character['Body Colors'].TorsoColor=BrickColor.new('Really black')
  355. Character['Body Colors'].RightArmColor=BrickColor.new('Really black')
  356. Character['Body Colors'].LeftArmColor=BrickColor.new('Really black')
  357. Character['Body Colors'].RightLegColor=BrickColor.new('Really black')
  358. Character['Body Colors'].LeftLegColor=BrickColor.new('Really black')
  359.  
  360. Humanoid.DisplayDistanceType='None'
  361.  
  362. --Part(Name,Color, Material, Transparency,Shape, Size, CFrame,CanCollide,Anchored,parent)
  363. --newWeld(wp0, wp1, wc0x, wc0y, wc0z)
  364. local REye=Part('REye','Royal purple','Neon',0,'Ball',Vector3.new(.1,.1,.1),CFrame.new(0,0,0),false,false,Character)
  365. newWeld(Head,REye,.2,.225,-.5)
  366. local REGlow=Instance.new('SurfaceLight')
  367. REGlow.Color=Color3.fromRGB(170,85,255)
  368. REGlow.Range=6
  369. REGlow.Brightness=10
  370. REGlow.Parent=REye
  371. local Glow=Instance.new('ParticleEmitter')
  372. Glow.Color=ColorSequence.new(Color3.fromRGB(170,85,255),Color3.fromRGB(170,85,255))
  373. Glow.Texture='rbxassetid://242292318'
  374. Glow.Transparency=NumberSequence.new(.9)
  375. Glow.Size=NumberSequence.new(.225)
  376. Glow.Acceleration=Vector3.new(45,30,0)
  377. Glow.LockedToPart=true
  378. Glow.Lifetime=NumberRange.new(.25,.25)
  379. Glow.Rate=1000
  380. Glow.EmissionDirection='Bottom'
  381. Glow.Speed=NumberRange.new(1,1)
  382. Glow.ZOffset=2
  383. Glow.Parent=REye
  384. local LEye=Part('LEye','Royal purple','Neon',0,'Ball',Vector3.new(.1,.1,.1),CFrame.new(0,0,0),false,false,Character)
  385. newWeld(Head,LEye,-.2,.225,-.5)
  386. local LEGlow=Instance.new('SurfaceLight')
  387. LEGlow.Color=Color3.fromRGB(170,85,255)
  388. LEGlow.Range=6
  389. LEGlow.Brightness=10
  390. LEGlow.Parent=LEye
  391. local Glow2=Instance.new('ParticleEmitter')
  392. Glow2.Color=ColorSequence.new(Color3.fromRGB(0,0,0),Color3.fromRGB(0,0,0))
  393. Glow2.Texture='rbxassetid://242292318'
  394. Glow2.Transparency=NumberSequence.new(.988)
  395. Glow2.Size=NumberSequence.new(5)
  396. Glow2.LockedToPart=false
  397. Glow2.Lifetime=NumberRange.new(.5,.5)
  398. Glow2.Rate=1000
  399. Glow2.EmissionDirection='Top'
  400. Glow2.Speed=NumberRange.new(1,1)
  401. Glow2.VelocitySpread=Vector3.new(0,0,60)
  402. Glow2.ZOffset=1
  403. Glow2.Parent=Torso
  404.  
  405. sine = 0
  406. change = 1
  407. sprint=false
  408. local punches={
  409. a=false,
  410. b=false,
  411. c=false
  412. }
  413.  
  414. UIService.InputBegan:connect(function(Input,GUIProcessed)
  415. if not GUIProcessed and Input.UserInputType==Enum.UserInputType.MouseButton1 then
  416. if punches.a==false then
  417. punches.a=true wait(.4) punches.a=false
  418. else
  419. punches.a=true
  420. print('a ',punches.a)
  421. if punches.b==false then
  422. punches.b=true wait(.4) punches.b=false
  423. else
  424. punches.b=true
  425. print('b ',punches.b)
  426. if punches.c==false then
  427. punches.c=true wait(.4) punches.c=false
  428. else
  429. punches.c=true
  430. print('c ',punches.c)
  431. print('a ',punches.a,'b ',punches.b,'c ',punches.c)
  432. end
  433. end
  434. end
  435. elseif not GUIProcessed and Input.KeyCode==Enum.KeyCode.LeftShift then
  436. sprint=true
  437. end
  438. end)
  439.  
  440. UIService.InputEnded:connect(function(Input,GUIProcessed)
  441. if not GUIProcessed and Input.KeyCode==Enum.KeyCode.LeftShift then
  442. sprint=false
  443. end
  444. end)
  445.  
  446. game:GetService("RunService").RenderStepped:connect(function()
  447. Angle = (Angle % 100) + angleSpeed/10
  448. Axis = (Axis % 100) + axisSpeed/10
  449. walkingMagnitude = Vector3.new(rootPart.Velocity.X, 0, rootPart.Velocity.Z).magnitude
  450. jumpVel = Torso.Velocity.Y
  451. sine = change + sine
  452.  
  453. if(Humanoid.Jump) and jumpVel > 1 then
  454. currentAnim = "Jumping"
  455. elseif walkingMagnitude < 2 then
  456. currentAnim = "Idling"
  457. elseif isSprinting == true then
  458. currentAnim = "Sprinting"
  459. elseif walkingMagnitude > 2 then
  460. currentAnim = "Walking"
  461. elseif isAttacking == true then
  462. currentAnim = "Attacking"
  463. end
  464.  
  465. if currentAnim == "Jumping" and Animations == false then
  466. angleSpeed = 2
  467. axisSpeed = 2
  468. RA_Weld.C0 = clerp(RA_Weld.C0, c_new(1.5, 0.5, 0) * c_angles(math.rad(0), math.rad(0), math.rad(0)), 0.15)
  469. LA_Weld.C0 = clerp(LA_Weld.C0, c_new(-1.5, 0.5, 0) * c_angles(math.rad(0), math.rad(0), math.rad(0)), 0.15)
  470. LL_Weld.C0 = clerp(LL_Weld.C0, c_new(-0.5, -1, 0) * c_angles(math.rad(0), math.rad(0), math.rad(0)), 0.15)
  471. RL_Weld.C0 = clerp(RL_Weld.C0, c_new(0.5, -1, 0) * c_angles(math.rad(0), math.rad(0), math.rad(0)), 0.15)
  472. Torso_Weld.C0 = clerp(Torso_Weld.C0, c_new(0, -1, 0) * c_angles(math.rad(0), math.rad(0), math.rad(0)), 0.15)
  473. Head_Weld.C0 = clerp(Head_Weld.C0, c_new(0, 1.5, 0) * c_angles(math.rad(0), math.rad(0), math.rad(0)), 0.15)
  474. elseif currentAnim == "Idling" and Animations == false then
  475. angleSpeed = 1
  476. axisSpeed = 1
  477. change = 0.5
  478. RA_Weld.C0 = clerp(RA_Weld.C0, c_new(1.5, .5, 0) * c_angles(math.rad(45), math.rad(-3), math.rad(-10)), 0.15)
  479. LA_Weld.C0 = clerp(LA_Weld.C0, c_new(-1.5, 0.5, 0) * c_angles(math.rad(45), math.rad(5), math.rad(20)), 0.15)
  480. LL_Weld.C0 = clerp(LL_Weld.C0, c_new(-0.5, -1, 0) * c_angles(math.rad(85), math.rad(0), math.rad(-20)), 0.15)
  481. RL_Weld.C0 = clerp(RL_Weld.C0, c_new(0.5, -1, 0) * c_angles(math.rad(85), math.rad(0), math.rad(30)), 0.15)
  482. Torso_Weld.C0 = clerp(Torso_Weld.C0, c_new(0, -2.5, 0) * c_angles(math.rad(10), math.rad(0), math.rad(0)), 0.15)
  483. Head_Weld.C0 = clerp(Head_Weld.C0, c_new(0, 1.5, 0) * c_angles(math.rad(0), math.rad(0), math.rad(0)), 0.15)
  484. elseif currentAnim == "Walking" and Animations == false then
  485. if sprint==false then
  486. angleSpeed = 1
  487. axisSpeed = 1
  488. Humanoid.WalkSpeed = 16
  489. RA_Weld.C0 = clerp(RA_Weld.C0, c_new(1.5, 0.5, 0) * c_angles(math.rad(0), -math.sin((rootPart.RotVelocity.X/5))/2, math.sin((-rootPart.RotVelocity.Y/5))/2), 0.15)
  490. LA_Weld.C0 = clerp(LA_Weld.C0, c_new(-1.5, 0.5, 0) * c_angles(math.rad(0), math.sin((rootPart.RotVelocity.X/5))/2, -math.sin((-rootPart.RotVelocity.Y/5))/2), 0.15)
  491. LL_Weld.C0 = clerp(LL_Weld.C0, c_new(-0.5, -1, 0) * c_angles(math.sin(sine/2)/1.5, math.sin((rootPart.RotVelocity.Y/5))/2, -math.sin((rootPart.RotVelocity.Y/5))/2), 0.15)
  492. RL_Weld.C0 = clerp(RL_Weld.C0, c_new(0.5, -1, 0) * c_angles(-math.sin(sine/2)/1.5, -math.sin((rootPart.RotVelocity.Y/5))/2, math.sin((-rootPart.RotVelocity.Y/5))/2), 0.15)
  493. Torso_Weld.C0 = clerp(Torso_Weld.C0, c_new(0, -1, 0) * c_angles(math.rad(0), math.rad(0), math.sin((rootPart.RotVelocity.Y/30))/2), 0.15)
  494. Head_Weld.C0 = clerp(Head_Weld.C0, c_new(0, 1.5, 0) * c_angles(math.rad(0), math.sin((rootPart.RotVelocity.Y/2.5))/2, math.rad(0)), 0.15)
  495. else
  496. angleSpeed = 10
  497. axisSpeed = 10
  498. Humanoid.WalkSpeed = 60
  499. RA_Weld.C0 = clerp(RA_Weld.C0, c_new(1.5, 0.5, 0) * c_angles(math.rad(-40)+(-math.sin(sine/20)/5), -math.sin((rootPart.RotVelocity.X/3))/2, math.sin((-rootPart.RotVelocity.Y/3))/2), 0.15)
  500. LA_Weld.C0 = clerp(LA_Weld.C0, c_new(-1.5, 0.5, 0) * c_angles(math.rad(-40)+(-math.sin(sine/20)/5), math.sin((rootPart.RotVelocity.X/3))/2, -math.sin((-rootPart.RotVelocity.Y/3))/2), 0.15)
  501. LL_Weld.C0 = clerp(LL_Weld.C0, c_new(-0.5, -1, 0) * c_angles(math.sin(sine/1)/1, math.sin((rootPart.RotVelocity.Y/3))/2, -math.sin((rootPart.RotVelocity.Y/3))/2), 0.15)
  502. RL_Weld.C0 = clerp(RL_Weld.C0, c_new(0.5, -1, 0) * c_angles(-math.sin(sine/1)/1, -math.sin((rootPart.RotVelocity.Y/3))/2, math.sin((-rootPart.RotVelocity.Y/3))/2), 0.15)
  503. Torso_Weld.C0 = clerp(Torso_Weld.C0, c_new(0, -1, 0) * c_angles(math.rad(-20), math.rad(0), math.sin((rootPart.RotVelocity.Y/15))/2), 0.15)
  504. Head_Weld.C0 = clerp(Head_Weld.C0, c_new(0, 1.5, 0) * c_angles(math.rad(0), math.sin((rootPart.RotVelocity.Y/1))/2, math.rad(0)), 0.15)
  505. end
  506. end
  507. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement