SHOW:
|
|
- or go back to the newest paste.
1 | local plr = game.Players.LocalPlayer | |
2 | local chr = plr.Character | |
3 | local maus = plr:GetMouse() | |
4 | local PGui=plr.PlayerGui | |
5 | local lleg = chr["Left Leg"] | |
6 | local rleg = chr["Right Leg"] | |
7 | local larm = chr["Left Arm"] | |
8 | local rarm = chr["Right Arm"] | |
9 | local hed = chr.Head | |
10 | local rutprt = chr.HumanoidRootPart | |
11 | local torso = chr.Torso | |
12 | local otheranims=false | |
13 | local armmovement=false | |
14 | chr.Animate.Disabled=true | |
15 | local RunSpeed=36 | |
16 | local WlkSpeed=18 | |
17 | local runnin=false | |
18 | local tik=0 | |
19 | local rollvalue=0 | |
20 | local swimming=false | |
21 | local fldb={['w']=false,['a']=false,['s']=false,['d']=false} | |
22 | local jumpval=0 | |
23 | local idlerollv=0 | |
24 | ||
25 | local BallColor=torso.BrickColor | |
26 | local BallTransparency=0.5 | |
27 | local BallReflectance=0 | |
28 | local BallMaterial="Plastic" | |
29 | ||
30 | ||
31 | ||
32 | coroutine.wrap(function() | |
33 | for i,x in pairs(hed:GetChildren()) do if x:IsA('Sound') then x:Destroy() end end end)() | |
34 | function Lerp(a, b, i) | |
35 | local com1 = {a.X, a.Y, a.Z, a:toEulerAnglesXYZ()} | |
36 | local com2 = {b.X, b.Y, b.Z, b:toEulerAnglesXYZ()} | |
37 | local calx = com1[1] + (com2[1] - com1[1]) * i | |
38 | local caly = com1[2] + (com2[2] - com1[2]) * i | |
39 | local calz = com1[3] + (com2[3] - com1[3]) * i | |
40 | local cala = com1[4] + (com2[4] - com1[4]) * i | |
41 | local calb = com1[5] + (com2[5] - com1[5]) * i | |
42 | local calc = com1[6] + (com2[6] - com1[6]) * i | |
43 | return CFrame.new(calx, caly, calz) * CFrame.Angles(cala, calb, calc) | |
44 | end | |
45 | function TwnSingleNumber(s,f,m) | |
46 | local wot=s+(f-s)*m | |
47 | return wot | |
48 | end | |
49 | function TwnVector3(q,w,e) | |
50 | local begin={q.x,q.y,q.z} | |
51 | local ending={w.x,w.y,w.z} | |
52 | local bgx=begin[1]+(ending[1]-begin[1])*e | |
53 | local bgy=begin[2]+(ending[2]-begin[2])*e | |
54 | local bgz=begin[3]+(ending[3]-begin[3])*e | |
55 | return Vector3.new(bgx,bgy,bgz) | |
56 | end | |
57 | newWeld = function(wld, wp0, wp1, wc0x, wc0y, wc0z) | |
58 | wld = Instance.new("Weld", wp1) | |
59 | wld.Part0 = wp0 | |
60 | wld.Part1 = wp1 | |
61 | wld.C0 = CFrame.new(wc0x, wc0y, wc0z) | |
62 | end | |
63 | function Avg(a, b) | |
64 | return CFrame.new((a.X+b.X)/2,(a.Y+b.Y)/2,(a.Z+b.Z)/2) | |
65 | end | |
66 | ||
67 | local jump=Instance.new('Sound',rutprt) | |
68 | jump.Volume=.2 | |
69 | jump.Pitch=1 | |
70 | jump.SoundId='http://www.roblox.com/asset?id=170588191' | |
71 | ||
72 | newWeld(law, torso, larm, -1.5, 0.5, 0) | |
73 | newWeld(raw, torso, rarm, 1.5, 0.5, 0) | |
74 | newWeld(llw, torso, lleg, -.5, -2, 0) | |
75 | newWeld(rlw, torso, rleg, .5, -2, 0) | |
76 | newWeld(hw, torso, hed, 0, 1.5, 0) | |
77 | local rutwald=Instance.new('Weld',rutprt) | |
78 | rutwald.Part0=rutprt | |
79 | rutwald.Part1=torso | |
80 | larm.Weld.C1 = CFrame.new(0, 0.5, 0) | |
81 | rarm.Weld.C1 = CFrame.new(0, 0.5, 0) | |
82 | rleg.Weld.C1=CFrame.new(0,0,0)*CFrame.Angles(math.rad(0),0,0) | |
83 | lleg.Weld.C1=CFrame.new(0,0,0)*CFrame.Angles(math.rad(0),0,0) | |
84 | ||
85 | local anim = "Idling" | |
86 | local lastanim = "Idling" | |
87 | local val = 0 | |
88 | local syne = 0 | |
89 | local num = 0 | |
90 | local runtime = 0 | |
91 | ||
92 | maus.KeyDown:connect(function(kei) | |
93 | if string.byte(kei)==48 and not otheranims and not sitting and not disabled then | |
94 | runnin=true | |
95 | end | |
96 | if kei=='w' then fldb.w=true end | |
97 | if kei=='a' then fldb.a=true end | |
98 | if kei=='s' then fldb.s=true end | |
99 | if kei=='d' then fldb.d=true end | |
100 | end) | |
101 | maus.KeyUp:connect(function(kei) | |
102 | if string.byte(kei)==48 and not otheranims and not sitting and not disabled then | |
103 | runnin=false | |
104 | end | |
105 | if kei=='w' then fldb.w=false end | |
106 | if kei=='a' then fldb.a=false end | |
107 | if kei=='s' then fldb.s=false end | |
108 | if kei=='d' then fldb.d=false end | |
109 | end) | |
110 | ||
111 | local bawl=Instance.new("Part",torso) | |
112 | bawl.formFactor="Custom" | |
113 | bawl.Shape="Ball" | |
114 | bawl.BrickColor=(BallColor or torso.BrickColor) | |
115 | bawl.Material=BallMaterial | |
116 | bawl.Transparency=(BallTransparency or 0) | |
117 | bawl.Reflectance=(BallReflectance or 0) | |
118 | bawl.Size=Vector3.new(5.35,5.35,5.35) | |
119 | bawl.TopSurface=10 | |
120 | bawl.BottomSurface=10 | |
121 | bawl.LeftSurface=10 | |
122 | bawl.RightSurface=10 | |
123 | bawl.FrontSurface=10 | |
124 | bawl.BackSurface=10 | |
125 | bawl.Anchored=false | |
126 | bawl:breakJoints'' | |
127 | bawl.Locked=true | |
128 | bawl.CanCollide=true | |
129 | --[[local bawlmesh=Instance.new("SpecialMesh",bawl) | |
130 | bawlmesh.MeshId="http://www.roblox.com/asset/?id=1527559" | |
131 | --bawlmesh.TextureId="http://www.roblox.com/asset?id=25701026" | |
132 | bawlmesh.Scale=Vector3.new(2.35,2.35,2.35)]] | |
133 | local bawllight=Instance.new("PointLight",bawl) | |
134 | bawllight.Brightness=1 | |
135 | bawllight.Range=15 | |
136 | bawllight.Color=bawl.BrickColor.Color | |
137 | bawllight.Shadows=true | |
138 | local bawlweld=Instance.new("Weld",bawl) | |
139 | bawlweld.Part0=rutprt | |
140 | bawlweld.Part1=bawl | |
141 | bawlweld.C1=CFrame.new(0,0,0) | |
142 | rutprt.Weld.C1=CFrame.new(0,-bawl.Size.y,0)*CFrame.Angles(math.rad(0),math.rad(0),0) | |
143 | ||
144 | part = Instance.new("Part", bawl) | |
145 | part.CFrame=bawl.CFrame | |
146 | mehs = Instance.new("SpecialMesh", part) | |
147 | - | mehs.MeshId="rbxassetid://536350485" |
147 | + | mehs.MeshId="rbxassetid://430069460" |
148 | - | mehs.TextureId="rbxassetid://536350488" |
148 | + | mehs.TextureId="rbxassetid://430069464" |
149 | local partweld=Instance.new("Weld", part) | |
150 | partweld.Part0=bawl | |
151 | partweld.Part1=part | |
152 | partweld.C1=CFrame.new(0,0,0) | |
153 | ||
154 | - | wari = Instance.new("Sound", bawl) |
154 | + | soni = Instance.new("Sound", bawl) |
155 | - | wari.SoundId="rbxassetid://167067148" |
155 | + | soni.SoundId="rbxassetid://534526212" |
156 | - | wari.Looped = true |
156 | + | soni.Looped = true |
157 | - | wari.Playing = true |
157 | + | soni.Playing = true |
158 | - | wari.Volume = 0.3 |
158 | + | soni.Volume = 1 |
159 | ||
160 | chr.Humanoid.Swimming:connect(function(speedpls) | |
161 | if speedpls>=5 and not otheranims and not disabled and not sitting then | |
162 | swimming=true | |
163 | anim="Swimming" | |
164 | elseif speedpls<5 and not otheranims and not disabled and not sitting then | |
165 | swimming=false | |
166 | end | |
167 | end) | |
168 | ||
169 | coroutine.resume(coroutine.create(function() | |
170 | while true do | |
171 | if trailing then | |
172 | local Ray=Ray.new(rutprt.CFrame.p,(rutprt.CFrame.p-(rutprt.CFrame*CFrame.new(0,-2,0)).p).unit*-5) | |
173 | local hitbrick,hitposition=Workspace:FindPartOnRay(Ray,chr) | |
174 | if hitbrick and hitposition then | |
175 | local splash=Instance.new("Part",bawl) | |
176 | splash.Anchored=true | |
177 | splash.CanCollide=false | |
178 | splash.Transparency=0 | |
179 | splash.formFactor="Custom" | |
180 | splash.BrickColor=hitbrick.BrickColor | |
181 | splash.Size=Vector3.new(2,2,2) | |
182 | game:service'Debris':AddItem(splash,2) | |
183 | splash.CFrame=CFrame.new(hitposition)*CFrame.Angles(math.random(1,3),math.random(1,3),math.random(1,3)) | |
184 | local splm=Instance.new("BlockMesh",splash) | |
185 | coroutine.wrap(function() | |
186 | for a=0,1,.05 do | |
187 | splm.Scale=Vector3.new(a,a,a) splash.Transparency=splash.Transparency+.05 splash.CFrame=splash.CFrame+Vector3.new(0,.05,0) wait'' end | |
188 | end)() | |
189 | end | |
190 | wait'' | |
191 | else | |
192 | wait'' | |
193 | end | |
194 | end | |
195 | end)) | |
196 | ||
197 | game:service'RunService'.RenderStepped:connect(function() | |
198 | syne=syne+1 | |
199 | if not otheranims and not swimming then | |
200 | 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 | |
201 | anim="Idling" | |
202 | ||
203 | 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 | |
204 | anim="Walking" | |
205 | dnc=false | |
206 | ||
207 | 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 | |
208 | anim="Sprinting" | |
209 | dnc=false | |
210 | ||
211 | elseif torso.Velocity.y>5 and chr.Humanoid.Jump then | |
212 | anim='Jumping' | |
213 | dnc=false | |
214 | ||
215 | elseif (torso.Velocity.y < -5) and chr.Humanoid.Jump then | |
216 | anim='Falling' | |
217 | dnc=false | |
218 | ||
219 | end | |
220 | end | |
221 | ||
222 | if anim~=lastanim then runtime=0 end | |
223 | lastanim=anim | |
224 | ||
225 | if anim=="Idling" then | |
226 | trailing=false | |
227 | if not armmovement then | |
228 | 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) | |
229 | 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) | |
230 | end | |
231 | 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) | |
232 | 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) | |
233 | 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) | |
234 | 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) | |
235 | bawlweld.C0=Lerp(bawlweld.C0,CFrame.new(0,-.5,-math.cos(syne/25)*3)*CFrame.Angles(math.rad(rollvalue),0,0),.25) | |
236 | end | |
237 | ||
238 | ||
239 | if anim=="Walking" then | |
240 | trailing=true | |
241 | rollvalue=rollvalue+3 | |
242 | if rollvalue>=359 then rollvalue=0 bawlweld.C0=CFrame.new(0,-.5,0)*CFrame.Angles(-math.rad(rollvalue),0,-(math.cos(syne/4)/5)) | |
243 | 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)) | |
244 | else | |
245 | bawlweld.C0=Lerp(bawlweld.C0,CFrame.new(0,-.5,0)*CFrame.Angles(-math.rad(rollvalue),0,-(math.cos(syne/4)/5)),.2) end | |
246 | if not armmovement then | |
247 | 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) | |
248 | 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) | |
249 | end | |
250 | ||
251 | 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) | |
252 | ||
253 | 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) | |
254 | ||
255 | 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) | |
256 | end | |
257 | ||
258 | if anim=="Sprinting" then | |
259 | trailing=true | |
260 | rollvalue=rollvalue+5 | |
261 | if rollvalue>=359 then rollvalue=0 bawlweld.C0=CFrame.new(0,-.5,0)*CFrame.Angles(-math.rad(rollvalue),0,-(math.cos(syne/3)/5)) | |
262 | 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)) | |
263 | else | |
264 | bawlweld.C0=Lerp(bawlweld.C0,CFrame.new(0,-.5,0)*CFrame.Angles(-math.rad(rollvalue),0,-(math.cos(syne/3)/5)),.2) end | |
265 | if not armmovement then | |
266 | 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) | |
267 | 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) | |
268 | end | |
269 | ||
270 | 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) | |
271 | ||
272 | 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) | |
273 | ||
274 | 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) | |
275 | end | |
276 | ||
277 | if anim=="Falling" then | |
278 | trailing=false | |
279 | if not armmovement then | |
280 | rarm.Weld.C0=Lerp(rarm.Weld.C0,CFrame.new(1.5,.525,0)*CFrame.Angles(math.rad(25),0,math.rad(25)),.1) | |
281 | larm.Weld.C0=Lerp(larm.Weld.C0,CFrame.new(-1.5,.525,0)*CFrame.Angles(math.rad(25),0,math.rad(-25)),.1) | |
282 | end | |
283 | 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) | |
284 | 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) | |
285 | hed.Weld.C0=Lerp(hed.Weld.C0,CFrame.new(0,1.5,-.3)*CFrame.Angles(math.rad(-15),0,0),.1) | |
286 | 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) | |
287 | bawlweld.C0=Lerp(bawlweld.C0,CFrame.new(0,-.5,0)*CFrame.Angles(math.rad(rollvalue),0,0),.325) | |
288 | end | |
289 | ||
290 | if anim=="Jumping" then | |
291 | trailing=false | |
292 | if not armmovement then | |
293 | rarm.Weld.C0=Lerp(rarm.Weld.C0,CFrame.new(1.5,.525,0)*CFrame.Angles(math.rad(-25),0,math.rad(25)),.1) | |
294 | larm.Weld.C0=Lerp(larm.Weld.C0,CFrame.new(-1.5,.525,0)*CFrame.Angles(math.rad(-25),0,math.rad(-25)),.1) | |
295 | end | |
296 | 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) | |
297 | 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) | |
298 | hed.Weld.C0=Lerp(hed.Weld.C0,CFrame.new(0,1.5,.05)*CFrame.Angles(math.rad(15),0,0),.1) | |
299 | 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) | |
300 | bawlweld.C0=Lerp(bawlweld.C0,CFrame.new(0,-.5,0)*CFrame.Angles(math.rad(rollvalue),0,0),.325) | |
301 | end | |
302 | ||
303 | if anim=="WallRun" then | |
304 | chr.Humanoid.Jump=true | |
305 | trailing=false | |
306 | rollvalue=rollvalue+7 | |
307 | if rollvalue>=359 then rollvalue=0 bawlweld.C0=CFrame.new(0,-.5,0)*CFrame.Angles(-math.rad(rollvalue),0,-(math.cos(syne/3)/5)) | |
308 | 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)) | |
309 | else | |
310 | bawlweld.C0=Lerp(bawlweld.C0,CFrame.new(0,-.5,0)*CFrame.Angles(-math.rad(rollvalue),0,-(math.cos(syne/3)/5)),.2) end | |
311 | if not armmovement then | |
312 | rarm.Weld.C0=Lerp(rarm.Weld.C0,CFrame.new(1.325,.525,.2)*CFrame.Angles(math.rad(-45),0,math.rad(3)),.1) | |
313 | larm.Weld.C0=Lerp(larm.Weld.C0,CFrame.new(-1.325,.525,.2)*CFrame.Angles(math.rad(-45),0,math.rad(-3)),.1) | |
314 | end | |
315 | ||
316 | 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) | |
317 | ||
318 | 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) | |
319 | ||
320 | hed.Weld.C0=Lerp(hed.Weld.C0,CFrame.new(0,1.45,.25)*CFrame.Angles(math.rad(30),0,0),.1) | |
321 | 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) | |
322 | end | |
323 | ||
324 | ||
325 | if anim=="Swimming" then | |
326 | rollvalue=rollvalue+4 | |
327 | if rollvalue>=360 then rollvalue=0 end | |
328 | if not armmovement then | |
329 | 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) | |
330 | 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) | |
331 | end | |
332 | ||
333 | 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) | |
334 | ||
335 | 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) | |
336 | ||
337 | bawlweld.C0=Lerp(bawlweld.C0,CFrame.new(0,-.5,0)*CFrame.Angles(-math.rad(rollvalue),0,0),.25) | |
338 | 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) | |
339 | end | |
340 | ||
341 | chr.Humanoid.CameraOffset=(rutprt.CFrame:toObjectSpace(hed.CFrame)).p+Vector3.new(0,-1.25,0) | |
342 | ||
343 | if runnin and not disabled and not otheranims and not sitting then | |
344 | chr.Humanoid.WalkSpeed=RunSpeed | |
345 | elseif not runnin and not disabled and not otheranims and not sitting then | |
346 | chr.Humanoid.WalkSpeed=WlkSpeed | |
347 | end | |
348 | ||
349 | if rutprt:findFirstChild("WallRunningVelocitypls") and otheranims then | |
350 | local rei=Ray.new((rutprt.CFrame).p,(((rutprt.CFrame*CFrame.new(0,0,-1)).p)-rutprt.CFrame.p).unit*((bawl.Size.y/2))) | |
351 | local hitpart,hitpos=Workspace:FindPartOnRay(rei,chr) | |
352 | if not hitpart then | |
353 | otheranims=false | |
354 | rutprt:findFirstChild("WallRunningVelocitypls"):Destroy'' | |
355 | else | |
356 | return | |
357 | end | |
358 | end | |
359 | ||
360 | if runnin and (fldb.w or fldb.a or fldb.s or fldb.d) then | |
361 | local rei=Ray.new((rutprt.CFrame).p,(((rutprt.CFrame*CFrame.new(0,0,-1)).p)-rutprt.CFrame.p).unit*((bawl.Size.y/2))) | |
362 | local hitpart,hitpos=Workspace:FindPartOnRay(rei,chr) | |
363 | if hitpart and hitpart.CanCollide then | |
364 | otheranims=true | |
365 | anim="WallRun" | |
366 | if not rutprt:findFirstChild("WallRunningVelocitypls") then | |
367 | local wlvelo=Instance.new("BodyVelocity",rutprt) | |
368 | wlvelo.Name="WallRunningVelocitypls" | |
369 | wlvelo.maxForce=Vector3.new(0,math.huge,0) | |
370 | wlvelo.velocity=Vector3.new(0,RunSpeed*1.2,0) | |
371 | end | |
372 | end | |
373 | else | |
374 | if rutprt:findFirstChild("WallRunningVelocitypls") and otheranims then | |
375 | otheranims=false | |
376 | rutprt:findFirstChild("WallRunningVelocitypls"):destroy'' | |
377 | end | |
378 | end | |
379 | end) |