Advertisement
marioisdabomb

Untitled

Jan 8th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.04 KB | None | 0 0
  1. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  2. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  3. do
  4. print("FE Compatibility code by Mokiros")
  5. script.Parent = Player.Character
  6.  
  7. --RemoteEvent for communicating
  8. local Event = Instance.new("RemoteEvent")
  9. Event.Name = "UserInput_Event"
  10.  
  11. --Fake event to make stuff like Mouse.KeyDown work
  12. local function fakeEvent()
  13. local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  14. t.connect = t.Connect
  15. return t
  16. end
  17.  
  18. --Creating fake input objects with fake variables
  19. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  20. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  21. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  22. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  23. end}
  24. --Merged 2 functions into one by checking amount of arguments
  25. CAS.UnbindAction = CAS.BindAction
  26.  
  27. --This function will trigger the events that have been :Connect()'ed
  28. local function te(self,ev,...)
  29. local t = m[ev]
  30. if t and t._fakeEvent and t.Function then
  31. t.Function(...)
  32. end
  33. end
  34. m.TrigEvent = te
  35. UIS.TrigEvent = te
  36.  
  37. Event.OnServerEvent:Connect(function(plr,io)
  38. if plr~=Player then return end
  39. if io.isMouse then
  40. m.Target = io.Target
  41. m.Hit = io.Hit
  42. else
  43. local b = io.UserInputState == Enum.UserInputState.Begin
  44. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  45. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  46. end
  47. for _,t in pairs(CAS.Actions) do
  48. for _,k in pairs(t.Keys) do
  49. if k==io.KeyCode then
  50. t.Function(t.Name,io.UserInputState,io)
  51. end
  52. end
  53. end
  54. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  55. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  56. end
  57. end)
  58. Event.Parent = NLS([==[
  59. local Player = game:GetService("Players").LocalPlayer
  60. local Event = script:WaitForChild("UserInput_Event")
  61.  
  62. local UIS = game:GetService("UserInputService")
  63. local input = function(io,a)
  64. if a then return end
  65. --Since InputObject is a client-side instance, we create and pass table instead
  66. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  67. end
  68. UIS.InputBegan:Connect(input)
  69. UIS.InputEnded:Connect(input)
  70.  
  71. local Mouse = Player:GetMouse()
  72. local h,t
  73. --Give the server mouse data 30 times every second, but only if the values changed
  74. --If player is not moving their mouse, client won't fire events
  75. while wait(1/30) do
  76. if h~=Mouse.Hit or t~=Mouse.Target then
  77. h,t=Mouse.Hit,Mouse.Target
  78. Event:FireServer({isMouse=true,Target=t,Hit=h})
  79. end
  80. end]==],Player.Character)
  81. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  82. end
  83.  
  84. local plr = owner
  85. local chr = plr.Character
  86. local maus = plr:GetMouse()
  87. local PGui=plr.PlayerGui
  88. local lleg = chr["Left Leg"]
  89. local rleg = chr["Right Leg"]
  90. local larm = chr["Left Arm"]
  91. local rarm = chr["Right Arm"]
  92. local hed = chr.Head
  93. local rutprt = chr.HumanoidRootPart
  94. local torso = chr.Torso
  95. local otheranims=false
  96. local armmovement=false
  97. chr.Animate.Disabled=true
  98. local RunSpeed=36
  99. local WlkSpeed=18
  100. local runnin=false
  101. local tik=0
  102. local rollvalue=0
  103. local swimming=false
  104. local fldb={['w']=false,['a']=false,['s']=false,['d']=false}
  105. local jumpval=0
  106. local idlerollv=0
  107.  
  108. local BallColor=torso.BrickColor
  109. local BallTransparency=0
  110. local BallReflectance=0
  111. local BallMaterial="Neon"
  112.  
  113.  
  114.  
  115. coroutine.wrap(function()
  116. for i,x in pairs(hed:GetChildren()) do if x:IsA('Sound') then x:Destroy() end end end)()
  117. function Lerp(a, b, i)
  118. local com1 = {a.X, a.Y, a.Z, a:toEulerAnglesXYZ()}
  119. local com2 = {b.X, b.Y, b.Z, b:toEulerAnglesXYZ()}
  120. local calx = com1[1] + (com2[1] - com1[1]) * i
  121. local caly = com1[2] + (com2[2] - com1[2]) * i
  122. local calz = com1[3] + (com2[3] - com1[3]) * i
  123. local cala = com1[4] + (com2[4] - com1[4]) * i
  124. local calb = com1[5] + (com2[5] - com1[5]) * i
  125. local calc = com1[6] + (com2[6] - com1[6]) * i
  126. return CFrame.new(calx, caly, calz) * CFrame.Angles(cala, calb, calc)
  127. end
  128. function TwnSingleNumber(s,f,m)
  129. local wot=s+(f-s)*m
  130. return wot
  131. end
  132. function TwnVector3(q,w,e)
  133. local begin={q.x,q.y,q.z}
  134. local ending={w.x,w.y,w.z}
  135. local bgx=begin[1]+(ending[1]-begin[1])*e
  136. local bgy=begin[2]+(ending[2]-begin[2])*e
  137. local bgz=begin[3]+(ending[3]-begin[3])*e
  138. return Vector3.new(bgx,bgy,bgz)
  139. end
  140. newWeld = function(wld, wp0, wp1, wc0x, wc0y, wc0z)
  141. wld = Instance.new("Weld", wp1)
  142. wld.Part0 = wp0
  143. wld.Part1 = wp1
  144. wld.C0 = CFrame.new(wc0x, wc0y, wc0z)
  145. end
  146. function Avg(a, b)
  147. return CFrame.new((a.X+b.X)/2,(a.Y+b.Y)/2,(a.Z+b.Z)/2)
  148. end
  149.  
  150. local jump=Instance.new('Sound',rutprt)
  151. jump.Volume=.2
  152. jump.Pitch=1
  153. jump.SoundId='http://www.roblox.com/asset?id=170588191'
  154.  
  155. newWeld(law, torso, larm, -1.5, 0.5, 0)
  156. newWeld(raw, torso, rarm, 1.5, 0.5, 0)
  157. newWeld(llw, torso, lleg, -.5, -2, 0)
  158. newWeld(rlw, torso, rleg, .5, -2, 0)
  159. newWeld(hw, torso, hed, 0, 1.5, 0)
  160. local rutwald=Instance.new('Weld',rutprt)
  161. rutwald.Part0=rutprt
  162. rutwald.Part1=torso
  163. larm.Weld.C1 = CFrame.new(0, 0.5, 0)
  164. rarm.Weld.C1 = CFrame.new(0, 0.5, 0)
  165. rleg.Weld.C1=CFrame.new(0,0,0)*CFrame.Angles(math.rad(0),0,0)
  166. lleg.Weld.C1=CFrame.new(0,0,0)*CFrame.Angles(math.rad(0),0,0)
  167.  
  168. local anim = "Idling"
  169. local lastanim = "Idling"
  170. local val = 0
  171. local syne = 0
  172. local num = 0
  173. local runtime = 0
  174.  
  175. maus.KeyDown:connect(function(kei)
  176. if string.byte(kei)==48 and not otheranims and not sitting and not disabled then
  177. runnin=true
  178. end
  179. if kei=='w' then fldb.w=true end
  180. if kei=='a' then fldb.a=true end
  181. if kei=='s' then fldb.s=true end
  182. if kei=='d' then fldb.d=true end
  183. end)
  184. maus.KeyUp:connect(function(kei)
  185. if string.byte(kei)==48 and not otheranims and not sitting and not disabled then
  186. runnin=false
  187. end
  188. if kei=='w' then fldb.w=false end
  189. if kei=='a' then fldb.a=false end
  190. if kei=='s' then fldb.s=false end
  191. if kei=='d' then fldb.d=false end
  192. end)
  193.  
  194. local bawl=Instance.new("Part",torso)
  195. bawl.formFactor="Custom"
  196. bawl.Shape="Ball"
  197. bawl.BrickColor=(BallColor or torso.BrickColor)
  198. bawl.Material=BallMaterial
  199. bawl.Transparency=(BallTransparency or 0)
  200. bawl.Reflectance=(BallReflectance or 0)
  201. bawl.Size=Vector3.new(5.35,5.35,5.35)
  202. bawl.TopSurface=10
  203. bawl.BottomSurface=10
  204. bawl.LeftSurface=10
  205. bawl.RightSurface=10
  206. bawl.FrontSurface=10
  207. bawl.BackSurface=10
  208. bawl.Anchored=false
  209. bawl:breakJoints''
  210. bawl.Locked=true
  211. bawl.CanCollide=true
  212. --[[local bawlmesh=Instance.new("SpecialMesh",bawl)
  213. bawlmesh.MeshId="http://www.roblox.com/asset/?id=1527559"
  214. --bawlmesh.TextureId="http://www.roblox.com/asset?id=25701026"
  215. bawlmesh.Scale=Vector3.new(2.35,2.35,2.35)]]
  216. local bawllight=Instance.new("PointLight",bawl)
  217. bawllight.Brightness=1
  218. bawllight.Range=15
  219. bawllight.Color=bawl.BrickColor.Color
  220. bawllight.Shadows=true
  221. local bawlweld=Instance.new("Weld",bawl)
  222. bawlweld.Part0=rutprt
  223. bawlweld.Part1=bawl
  224. bawlweld.C1=CFrame.new(0,0,0)
  225. rutprt.Weld.C1=CFrame.new(0,-bawl.Size.y,0)*CFrame.Angles(math.rad(0),math.rad(0),0)
  226.  
  227. chr.Humanoid.Swimming:connect(function(speedpls)
  228. if speedpls>=5 and not otheranims and not disabled and not sitting then
  229. swimming=true
  230. anim="Swimming"
  231. elseif speedpls<5 and not otheranims and not disabled and not sitting then
  232. swimming=false
  233. end
  234. end)
  235.  
  236. coroutine.resume(coroutine.create(function()
  237. while true do
  238. if trailing then
  239. local Ray=Ray.new(rutprt.CFrame.p,(rutprt.CFrame.p-(rutprt.CFrame*CFrame.new(0,-2,0)).p).unit*-5)
  240. local hitbrick,hitposition=Workspace:FindPartOnRay(Ray,chr)
  241. if hitbrick and hitposition then
  242. local splash=Instance.new("Part",bawl)
  243. splash.Anchored=true
  244. splash.CanCollide=false
  245. splash.Transparency=0
  246. splash.formFactor="Custom"
  247. splash.BrickColor=hitbrick.BrickColor
  248. splash.Size=Vector3.new(2,2,2)
  249. game:service'Debris':AddItem(splash,2)
  250. splash.CFrame=CFrame.new(hitposition)*CFrame.Angles(math.random(1,3),math.random(1,3),math.random(1,3))
  251. local splm=Instance.new("BlockMesh",splash)
  252. coroutine.wrap(function()
  253. for a=0,1,.05 do
  254. splm.Scale=Vector3.new(a,a,a) splash.Transparency=splash.Transparency+.05 splash.CFrame=splash.CFrame+Vector3.new(0,.05,0) wait'' end
  255. end)()
  256. end
  257. wait''
  258. else
  259. wait''
  260. end
  261. end
  262. end))
  263.  
  264. game:service'RunService'.RenderStepped:connect(function()
  265. syne=syne+1
  266. if not otheranims and not swimming then
  267. if (torso.Velocity*Vector3.new(1, 0, 1)).magnitude < 1 and not dnc and not chr.Humanoid.Jump then-- and torso.Velocity.y<5 and torso.Velocity.y>-5
  268. anim="Idling"
  269.  
  270. elseif (rutprt.Velocity*Vector3.new(1, 0, 1)).magnitude > 1 and (rutprt.Velocity*Vector3.new(1, 0, 1)).magnitude < RunSpeed-5 and not chr.Humanoid.Jump then-- and torso.Velocity.y<5 and torso.Velocity.y>-5
  271. anim="Walking"
  272. dnc=false
  273.  
  274. elseif (torso.Velocity*Vector3.new(1, 0, 1)).magnitude > RunSpeed-10 and not chr.Humanoid.Jump then-- and torso.Velocity.y<5 and torso.Velocity.y>-5
  275. anim="Sprinting"
  276. dnc=false
  277.  
  278. elseif torso.Velocity.y>5 and chr.Humanoid.Jump then
  279. anim='Jumping'
  280. dnc=false
  281.  
  282. elseif (torso.Velocity.y < -5) and chr.Humanoid.Jump then
  283. anim='Falling'
  284. dnc=false
  285.  
  286. end
  287. end
  288.  
  289. if anim~=lastanim then runtime=0 end
  290. lastanim=anim
  291.  
  292. if anim=="Idling" then
  293. trailing=false
  294. if not armmovement then
  295. rarm.Weld.C0=Lerp(rarm.Weld.C0,CFrame.new(1.5,.525+math.cos(syne/32.5)/25,0)*CFrame.Angles(0,0,math.rad(3)),.1)
  296. larm.Weld.C0=Lerp(larm.Weld.C0,CFrame.new(-1.5,.525+math.cos(syne/32.5)/25,0)*CFrame.Angles(0,0,math.rad(-3)),.1)
  297. end
  298. lleg.Weld.C0=Lerp(lleg.Weld.C0,CFrame.new(-.55,-1.9-math.cos(syne/32.5)/20,(math.cos(syne/32.5)/35))*CFrame.Angles(-(math.cos(syne/32.5)/35),0,math.rad(-2.5)),.1)
  299. rleg.Weld.C0=Lerp(rleg.Weld.C0,CFrame.new(.55,-1.9-math.cos(syne/32.5)/20,(math.cos(syne/32.5)/35))*CFrame.Angles(-(math.cos(syne/32.5)/35),0,math.rad(2.5)),.1)
  300. hed.Weld.C0=Lerp(hed.Weld.C0,CFrame.new(0,1.5+math.cos(syne/32.5)/50,0)*CFrame.Angles(math.cos(syne/32.5)/40,0,0),.1)
  301. rutprt.Weld.C0=Lerp(rutprt.Weld.C0,CFrame.new(0,-.4,-math.cos(syne/25)*3)*CFrame.Angles(math.cos(syne/25)/4,math.rad(0),math.rad(0)),.1)
  302. bawlweld.C0=Lerp(bawlweld.C0,CFrame.new(0,-.5,-math.cos(syne/25)*3)*CFrame.Angles(math.rad(rollvalue),0,0),.25)
  303. end
  304.  
  305.  
  306. if anim=="Walking" then
  307. trailing=true
  308. rollvalue=rollvalue+3
  309. if rollvalue>=359 then rollvalue=0 bawlweld.C0=CFrame.new(0,-.5,0)*CFrame.Angles(-math.rad(rollvalue),0,-(math.cos(syne/4)/5))
  310. elseif rollvalue>=177 and rollvalue<=183 then rollvalue=184 bawlweld.C0=CFrame.new(0,-.5,0)*CFrame.Angles(-math.rad(rollvalue),0,-(math.cos(syne/4)/5))
  311. else
  312. bawlweld.C0=Lerp(bawlweld.C0,CFrame.new(0,-.5,0)*CFrame.Angles(-math.rad(rollvalue),0,-(math.cos(syne/4)/5)),.2) end
  313. if not armmovement then
  314. rarm.Weld.C0=Lerp(rarm.Weld.C0,CFrame.new(1.5,.525-math.cos(syne/8)/6,math.cos(syne/8)/6)*CFrame.Angles(-math.cos(syne/8)/3+math.rad(25),0,math.rad(12.5)),.1)
  315. larm.Weld.C0=Lerp(larm.Weld.C0,CFrame.new(-1.5,.525+math.cos(syne/8)/6,-math.cos(syne/8)/6)*CFrame.Angles(math.cos(syne/8)/3+math.rad(25),0,math.rad(-12.5)),.1)
  316. end
  317.  
  318. lleg.Weld.C0=Lerp(lleg.Weld.C0,CFrame.new(-(math.cos(syne/8)/11)-.5,-1.7+math.sin(syne/4)/3.5-math.cos(syne/8)/4,math.rad(-5)-(math.cos(syne/8)))*CFrame.Angles(math.rad(5)+(math.cos(syne/8)),0,-(math.cos(syne/8)/11)+math.rad(1)),.1)
  319.  
  320. rleg.Weld.C0=Lerp(rleg.Weld.C0,CFrame.new(-(math.cos(syne/8)/11)+.5,-1.7-math.sin(syne/4)/3.5+math.cos(syne/8)/4,math.rad(-5)+(math.cos(syne/8)))*CFrame.Angles(math.rad(5)-(math.cos(syne/8)),0,-(math.cos(syne/8)/11)+math.rad(-1)),.1)
  321.  
  322. rutprt.Weld.C0=Lerp(rutprt.Weld.C0,CFrame.new(0,-.5-math.cos(syne/4)/2,-math.cos(syne/4)*1.5)*CFrame.Angles(math.cos(syne/4)/10+math.rad(-5),math.cos(syne/4)/10,math.cos(syne/8)/10+math.sin(rutprt.RotVelocity.y/2)/10),.1)
  323. end
  324.  
  325. if anim=="Sprinting" then
  326. trailing=true
  327. rollvalue=rollvalue+5
  328. if rollvalue>=359 then rollvalue=0 bawlweld.C0=CFrame.new(0,-.5,0)*CFrame.Angles(-math.rad(rollvalue),0,-(math.cos(syne/3)/5))
  329. elseif rollvalue>=177 and rollvalue<=183 then rollvalue=184 bawlweld.C0=CFrame.new(0,-.5,0)*CFrame.Angles(-math.rad(rollvalue),0,-(math.cos(syne/3)/5))
  330. else
  331. bawlweld.C0=Lerp(bawlweld.C0,CFrame.new(0,-.5,0)*CFrame.Angles(-math.rad(rollvalue),0,-(math.cos(syne/3)/5)),.2) end
  332. if not armmovement then
  333. rarm.Weld.C0=Lerp(rarm.Weld.C0,CFrame.new(1.5,.525-math.cos(syne/6)/6,math.sin(syne/6)/5)*CFrame.Angles(-math.cos(syne/6)/3+math.rad(25),0,math.rad(12.5)),.1)
  334. larm.Weld.C0=Lerp(larm.Weld.C0,CFrame.new(-1.5,.525+math.cos(syne/6)/6,-math.sin(syne/6)/5)*CFrame.Angles(math.cos(syne/6)/3+math.rad(25),0,math.rad(-12.5)),.1)
  335. end
  336.  
  337. lleg.Weld.C0=Lerp(lleg.Weld.C0,CFrame.new(-(math.cos(syne/6)/11)-.575,-1.7+math.cos(syne/3)/4-math.cos(syne/6)/4,math.rad(-5)-(math.cos(syne/6)))*CFrame.Angles(math.rad(5)+(math.cos(syne/6)),0,-(math.cos(syne/6)/11)+math.rad(-5)),.1)
  338.  
  339. rleg.Weld.C0=Lerp(rleg.Weld.C0,CFrame.new(-(math.cos(syne/6)/11)+.575,-1.7-math.cos(syne/3)/4+math.cos(syne/6)/4,math.rad(-5)+(math.cos(syne/6)))*CFrame.Angles(math.rad(5)-(math.cos(syne/6)),0,-(math.cos(syne/6)/11)+math.rad(5)),.1)
  340.  
  341. rutprt.Weld.C0=Lerp(rutprt.Weld.C0,CFrame.new(0,-.5-math.cos(syne/3)/2,-math.cos(syne/3)*1.5)*CFrame.Angles(math.cos(syne/3)/10+math.rad(-5),math.cos(syne/3)/10,math.cos(syne/6)/10+math.sin(rutprt.RotVelocity.y/2)/10),.1)
  342. end
  343.  
  344. if anim=="Falling" then
  345. trailing=false
  346. if not armmovement then
  347. rarm.Weld.C0=Lerp(rarm.Weld.C0,CFrame.new(1.5,.525,0)*CFrame.Angles(math.rad(25),0,math.rad(25)),.1)
  348. larm.Weld.C0=Lerp(larm.Weld.C0,CFrame.new(-1.5,.525,0)*CFrame.Angles(math.rad(25),0,math.rad(-25)),.1)
  349. end
  350. lleg.Weld.C0=Lerp(lleg.Weld.C0,CFrame.new(-.55,-1.9,math.rad(-20))*CFrame.Angles(math.rad(20),0,math.rad(-2.5)),.1)
  351. rleg.Weld.C0=Lerp(rleg.Weld.C0,CFrame.new(.55,-1.9,math.rad(-20))*CFrame.Angles(math.rad(20),0,math.rad(2.5)),.1)
  352. hed.Weld.C0=Lerp(hed.Weld.C0,CFrame.new(0,1.5,-.3)*CFrame.Angles(math.rad(-15),0,0),.1)
  353. rutprt.Weld.C0=Lerp(rutprt.Weld.C0,CFrame.new(0,rutprt.Weld.C0.y+.2,1.75)*CFrame.Angles(math.rad(-15),math.rad(0),math.rad(0)),.1)
  354. bawlweld.C0=Lerp(bawlweld.C0,CFrame.new(0,-.5,0)*CFrame.Angles(math.rad(rollvalue),0,0),.325)
  355. end
  356.  
  357. if anim=="Jumping" then
  358. trailing=false
  359. if not armmovement then
  360. rarm.Weld.C0=Lerp(rarm.Weld.C0,CFrame.new(1.5,.525,0)*CFrame.Angles(math.rad(-25),0,math.rad(25)),.1)
  361. larm.Weld.C0=Lerp(larm.Weld.C0,CFrame.new(-1.5,.525,0)*CFrame.Angles(math.rad(-25),0,math.rad(-25)),.1)
  362. end
  363. lleg.Weld.C0=Lerp(lleg.Weld.C0,CFrame.new(-.55,-1.9,math.rad(5))*CFrame.Angles(math.rad(-5),0,math.rad(-2.5)),.1)
  364. rleg.Weld.C0=Lerp(rleg.Weld.C0,CFrame.new(.55,-1.9,math.rad(5))*CFrame.Angles(math.rad(-5),0,math.rad(2.5)),.1)
  365. hed.Weld.C0=Lerp(hed.Weld.C0,CFrame.new(0,1.5,.05)*CFrame.Angles(math.rad(15),0,0),.1)
  366. rutprt.Weld.C0=Lerp(rutprt.Weld.C0,CFrame.new(0,rutprt.Weld.C0.y+.1,0)*CFrame.Angles(math.rad(5),math.rad(0),math.rad(0)),.1)
  367. bawlweld.C0=Lerp(bawlweld.C0,CFrame.new(0,-.5,0)*CFrame.Angles(math.rad(rollvalue),0,0),.325)
  368. end
  369.  
  370. if anim=="WallRun" then
  371. chr.Humanoid.Jump=true
  372. trailing=false
  373. rollvalue=rollvalue+7
  374. if rollvalue>=359 then rollvalue=0 bawlweld.C0=CFrame.new(0,-.5,0)*CFrame.Angles(-math.rad(rollvalue),0,-(math.cos(syne/3)/5))
  375. elseif rollvalue>=177 and rollvalue<=183 then rollvalue=184 bawlweld.C0=CFrame.new(0,-.5,0)*CFrame.Angles(-math.rad(rollvalue),0,-(math.cos(syne/3)/5))
  376. else
  377. bawlweld.C0=Lerp(bawlweld.C0,CFrame.new(0,-.5,0)*CFrame.Angles(-math.rad(rollvalue),0,-(math.cos(syne/3)/5)),.2) end
  378. if not armmovement then
  379. rarm.Weld.C0=Lerp(rarm.Weld.C0,CFrame.new(1.325,.525,.2)*CFrame.Angles(math.rad(-45),0,math.rad(3)),.1)
  380. larm.Weld.C0=Lerp(larm.Weld.C0,CFrame.new(-1.325,.525,.2)*CFrame.Angles(math.rad(-45),0,math.rad(-3)),.1)
  381. end
  382.  
  383. lleg.Weld.C0=Lerp(lleg.Weld.C0,CFrame.new(-(math.cos(syne/5)/11)-.575,-1.8-math.cos(syne/2.5)/2+math.cos(syne/5)/6,math.rad(-30)-(math.cos(syne/5)))*CFrame.Angles(math.rad(30)+(math.cos(syne/5)),0,-(math.cos(syne/5)/11)+math.rad(-5)),.1)
  384.  
  385. rleg.Weld.C0=Lerp(rleg.Weld.C0,CFrame.new(-(math.cos(syne/5)/11)+.575,-1.8+math.cos(syne/2.5)/2-math.cos(syne/5)/6,math.rad(-30)+(math.cos(syne/5)))*CFrame.Angles(math.rad(30)-(math.cos(syne/5)),0,-(math.cos(syne/5)/11)+math.rad(5)),.1)
  386.  
  387. hed.Weld.C0=Lerp(hed.Weld.C0,CFrame.new(0,1.45,.25)*CFrame.Angles(math.rad(30),0,0),.1)
  388. rutprt.Weld.C0=Lerp(rutprt.Weld.C0,CFrame.new(0,-1-math.cos(syne/2.5)/2,2-math.cos(syne/3)*1.5)*CFrame.Angles(math.cos(syne/2.5)/10+math.rad(-3),math.cos(syne/2.5)/10,math.cos(syne/5)/10+math.sin(rutprt.RotVelocity.y/2)/10),.1)
  389. end
  390.  
  391.  
  392. if anim=="Swimming" then
  393. rollvalue=rollvalue+4
  394. if rollvalue>=360 then rollvalue=0 end
  395. if not armmovement then
  396. rarm.Weld.C0=Lerp(rarm.Weld.C0,CFrame.new(1.5,.525-math.cos(syne/8)/6,math.cos(syne/8)/6)*CFrame.Angles(-math.cos(syne/8)/3+math.rad(25),0,math.rad(12.5)),.1)
  397. larm.Weld.C0=Lerp(larm.Weld.C0,CFrame.new(-1.5,.525+math.cos(syne/8)/6,-math.cos(syne/8)/6)*CFrame.Angles(math.cos(syne/8)/3+math.rad(25),0,math.rad(-12.5)),.1)
  398. end
  399.  
  400. lleg.Weld.C0=Lerp(lleg.Weld.C0,CFrame.new(-.55,-1.7+math.cos(syne/4)/4,math.rad(-5)-(math.cos(syne/8)))*CFrame.Angles(math.rad(5)+(math.cos(syne/8)),0,math.rad(-5)),.1)
  401.  
  402. rleg.Weld.C0=Lerp(rleg.Weld.C0,CFrame.new(.55,-1.7-math.cos(syne/4)/4,math.rad(-5)+(math.cos(syne/8)))*CFrame.Angles(math.rad(5)-(math.cos(syne/8)),0,math.rad(5)),.1)
  403.  
  404. bawlweld.C0=Lerp(bawlweld.C0,CFrame.new(0,-.5,0)*CFrame.Angles(-math.rad(rollvalue),0,0),.25)
  405. rutprt.Weld.C0=Lerp(rutprt.Weld.C0,CFrame.new(0,-.4-math.cos(syne/4)/4,-math.cos(syne/4)*1.25)*CFrame.Angles(math.cos(syne/4)/10+math.rad(95),math.cos(syne/4)/10,math.cos(syne/8)/10+math.sin(rutprt.RotVelocity.y/2)/10),.1)
  406. end
  407.  
  408. chr.Humanoid.CameraOffset=(rutprt.CFrame:toObjectSpace(hed.CFrame)).p+Vector3.new(0,-1.25,0)
  409.  
  410. if runnin and not disabled and not otheranims and not sitting then
  411. chr.Humanoid.WalkSpeed=RunSpeed
  412. elseif not runnin and not disabled and not otheranims and not sitting then
  413. chr.Humanoid.WalkSpeed=WlkSpeed
  414. end
  415.  
  416. if rutprt:findFirstChild("WallRunningVelocitypls") and otheranims then
  417. local rei=Ray.new((rutprt.CFrame).p,(((rutprt.CFrame*CFrame.new(0,0,-1)).p)-rutprt.CFrame.p).unit*((bawl.Size.y/2)))
  418. local hitpart,hitpos=Workspace:FindPartOnRay(rei,chr)
  419. if not hitpart then
  420. otheranims=false
  421. rutprt:findFirstChild("WallRunningVelocitypls"):Destroy''
  422. else
  423. return
  424. end
  425. end
  426.  
  427. if runnin and (fldb.w or fldb.a or fldb.s or fldb.d) then
  428. local rei=Ray.new((rutprt.CFrame).p,(((rutprt.CFrame*CFrame.new(0,0,-1)).p)-rutprt.CFrame.p).unit*((bawl.Size.y/2)))
  429. local hitpart,hitpos=Workspace:FindPartOnRay(rei,chr)
  430. if hitpart and hitpart.CanCollide then
  431. otheranims=true
  432. anim="WallRun"
  433. if not rutprt:findFirstChild("WallRunningVelocitypls") then
  434. local wlvelo=Instance.new("BodyVelocity",rutprt)
  435. wlvelo.Name="WallRunningVelocitypls"
  436. wlvelo.maxForce=Vector3.new(0,math.huge,0)
  437. wlvelo.velocity=Vector3.new(0,RunSpeed*1.2,0)
  438. end
  439. end
  440. else
  441. if rutprt:findFirstChild("WallRunningVelocitypls") and otheranims then
  442. otheranims=false
  443. rutprt:findFirstChild("WallRunningVelocitypls"):destroy''
  444. end
  445. end
  446. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement