SHOW:
|
|
- or go back to the newest paste.
1 | - | local Player = game.Players.localPlayer |
1 | + | -- This script has been converted to FE by iPxter |
2 | ||
3 | ||
4 | if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end | |
5 | local Player,Mouse,mouse,UserInputService,ContextActionService = owner | |
6 | do | |
7 | - | local mouse = Player:GetMouse() |
7 | + | print("FE Compatibility code by Mokiros | Translated to FE by iPxter") |
8 | script.Parent = Player.Character | |
9 | ||
10 | --RemoteEvent for communicating | |
11 | local Event = Instance.new("RemoteEvent") | |
12 | Event.Name = "UserInput_Event" | |
13 | ||
14 | --Fake event to make stuff like Mouse.KeyDown work | |
15 | local function fakeEvent() | |
16 | local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end} | |
17 | t.connect = t.Connect | |
18 | return t | |
19 | end | |
20 | ||
21 | --Creating fake input objects with fake variables | |
22 | local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()} | |
23 | local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()} | |
24 | local CAS = {Actions={},BindAction=function(self,name,fun,touch,...) | |
25 | CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil | |
26 | end} | |
27 | --Merged 2 functions into one by checking amount of arguments | |
28 | CAS.UnbindAction = CAS.BindAction | |
29 | ||
30 | --This function will trigger the events that have been :Connect()'ed | |
31 | local function te(self,ev,...) | |
32 | local t = m[ev] | |
33 | if t and t._fakeEvent and t.Function then | |
34 | t.Function(...) | |
35 | end | |
36 | end | |
37 | m.TrigEvent = te | |
38 | UIS.TrigEvent = te | |
39 | ||
40 | Event.OnServerEvent:Connect(function(plr,io) | |
41 | if plr~=Player then return end | |
42 | if io.isMouse then | |
43 | m.Target = io.Target | |
44 | m.Hit = io.Hit | |
45 | else | |
46 | local b = io.UserInputState == Enum.UserInputState.Begin | |
47 | if io.UserInputType == Enum.UserInputType.MouseButton1 then | |
48 | return m:TrigEvent(b and "Button1Down" or "Button1Up") | |
49 | end | |
50 | for _,t in pairs(CAS.Actions) do | |
51 | for _,k in pairs(t.Keys) do | |
52 | if k==io.KeyCode then | |
53 | t.Function(t.Name,io.UserInputState,io) | |
54 | end | |
55 | end | |
56 | end | |
57 | m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower()) | |
58 | UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false) | |
59 | end | |
60 | end) | |
61 | Event.Parent = NLS([==[ | |
62 | local Player = game:GetService("Players").LocalPlayer | |
63 | local Event = script:WaitForChild("UserInput_Event") | |
64 | ||
65 | local UIS = game:GetService("UserInputService") | |
66 | local input = function(io,a) | |
67 | if a then return end | |
68 | --Since InputObject is a client-side instance, we create and pass table instead | |
69 | Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState}) | |
70 | end | |
71 | UIS.InputBegan:Connect(input) | |
72 | UIS.InputEnded:Connect(input) | |
73 | ||
74 | local Mouse = Player:GetMouse() | |
75 | local h,t | |
76 | --Give the server mouse data 30 times every second, but only if the values changed | |
77 | --If player is not moving their mouse, client won't fire events | |
78 | while wait(1/30) do | |
79 | if h~=Mouse.Hit or t~=Mouse.Target then | |
80 | h,t=Mouse.Hit,Mouse.Target | |
81 | Event:FireServer({isMouse=true,Target=t,Hit=h}) | |
82 | end | |
83 | end]==],Player.Character) | |
84 | Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS | |
85 | end | |
86 | ||
87 | local Player = owner | |
88 | local Character = Player.Character | |
89 | local red = 255 | |
90 | local green = 255 | |
91 | local blue = 255 | |
92 | local Humanoid = Character.Humanoid | |
93 | local m = Instance.new("Model", Character) | |
94 | m.Name = "WeaponModel" | |
95 | local LeftArm = Character["Left Arm"] | |
96 | local RightArm = Character["Right Arm"] | |
97 | local LeftLeg = Character["Left Leg"] | |
98 | local RightLeg = Character["Right Leg"] | |
99 | local Head = Character.Head | |
100 | local Torso = Character.Torso | |
101 | local cam = game.Workspace.CurrentCamera | |
102 | local RootPart = Character.HumanoidRootPart | |
103 | local RootJoint = RootPart.RootJoint | |
104 | local equipped = false | |
105 | local attack = false | |
106 | local Anim = "Idle" | |
107 | local idle = 0 | |
108 | local attacktype = 1 | |
109 | local Torsovelocity = (RootPart.Velocity * Vector3.new(1, 0, 1)).magnitude | |
110 | local velocity = RootPart.Velocity.y | |
111 | local sine = 0 | |
112 | local change = 1 | |
113 | local grabbed = false | |
114 | local cn = CFrame.new | |
115 | local mr = math.rad | |
116 | local angles = CFrame.Angles | |
117 | local ud = UDim2.new | |
118 | local c3 = Color3.new | |
119 | local lim = 0 | |
120 | local st = 0 | |
121 | local necko = cn(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0) | |
122 | local attacktype = 1 | |
123 | local ZTarget, RocketTarget = nil, nil | |
124 | local euler = CFrame.fromEulerAnglesXYZ | |
125 | function clerp(a,b,t) | |
126 | local qa = {QuaternionFromCFrame(a)} | |
127 | local qb = {QuaternionFromCFrame(b)} | |
128 | local ax, ay, az = a.x, a.y, a.z | |
129 | local bx, by, bz = b.x, b.y, b.z | |
130 | local _t = 1-t | |
131 | return QuaternionToCFrame(_t*ax + t*bx, _t*ay + t*by, _t*az + t*bz,QuaternionSlerp(qa, qb, t)) | |
132 | end | |
133 | ||
134 | function QuaternionFromCFrame(cf) | |
135 | local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components() | |
136 | local trace = m00 + m11 + m22 | |
137 | if trace > 0 then | |
138 | local s = math.sqrt(1 + trace) | |
139 | local recip = 0.5/s | |
140 | return (m21-m12)*recip, (m02-m20)*recip, (m10-m01)*recip, s*0.5 | |
141 | else | |
142 | local i = 0 | |
143 | if m11 > m00 then | |
144 | i = 1 | |
145 | end | |
146 | if m22 > (i == 0 and m00 or m11) then | |
147 | i = 2 | |
148 | end | |
149 | if i == 0 then | |
150 | local s = math.sqrt(m00-m11-m22+1) | |
151 | local recip = 0.5/s | |
152 | return 0.5*s, (m10+m01)*recip, (m20+m02)*recip, (m21-m12)*recip | |
153 | elseif i == 1 then | |
154 | local s = math.sqrt(m11-m22-m00+1) | |
155 | local recip = 0.5/s | |
156 | return (m01+m10)*recip, 0.5*s, (m21+m12)*recip, (m02-m20)*recip | |
157 | elseif i == 2 then | |
158 | local s = math.sqrt(m22-m00-m11+1) | |
159 | local recip = 0.5/s return (m02+m20)*recip, (m12+m21)*recip, 0.5*s, (m10-m01)*recip | |
160 | end | |
161 | end | |
162 | end | |
163 | ||
164 | function QuaternionToCFrame(px, py, pz, x, y, z, w) | |
165 | local xs, ys, zs = x + x, y + y, z + z | |
166 | local wx, wy, wz = w*xs, w*ys, w*zs | |
167 | local xx = x*xs | |
168 | local xy = x*ys | |
169 | local xz = x*zs | |
170 | local yy = y*ys | |
171 | local yz = y*zs | |
172 | local zz = z*zs | |
173 | 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)) | |
174 | end | |
175 | ||
176 | function QuaternionSlerp(a, b, t) | |
177 | local cosTheta = a[1]*b[1] + a[2]*b[2] + a[3]*b[3] + a[4]*b[4] | |
178 | local startInterp, finishInterp; | |
179 | if cosTheta >= 0.0001 then | |
180 | if (1 - cosTheta) > 0.0001 then | |
181 | local theta = math.acos(cosTheta) | |
182 | local invSinTheta = 1/math.sin(theta) | |
183 | startInterp = math.sin((1-t)*theta)*invSinTheta | |
184 | finishInterp = math.sin(t*theta)*invSinTheta | |
185 | else | |
186 | startInterp = 1-t | |
187 | finishInterp = t | |
188 | end | |
189 | else | |
190 | if (1+cosTheta) > 0.0001 then | |
191 | local theta = math.acos(-cosTheta) | |
192 | local invSinTheta = 1/math.sin(theta) | |
193 | startInterp = math.sin((t-1)*theta)*invSinTheta | |
194 | finishInterp = math.sin(t*theta)*invSinTheta | |
195 | else | |
196 | startInterp = t-1 | |
197 | finishInterp = t | |
198 | end | |
199 | end | |
200 | 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 | |
201 | end | |
202 | rayCast = function(Position, Direction, Range, Ignore) | |
203 | return game:service("Workspace"):FindPartOnRay(Ray.new(Position, Direction.unit * (Range or 999.999)), Ignore) | |
204 | end | |
205 | local v = game.Players.localPlayer | |
206 | local torso = v.Character.Torso | |
207 | wait(1) | |
208 | local p = Instance.new("Part", v.Character) | |
209 | p.Name = "kit" | |
210 | p.Anchored = true | |
211 | p.Transparency = 0 | |
212 | p.Material = "Plastic" | |
213 | p.CanCollide = false | |
214 | p.TopSurface = 0 | |
215 | p.BottomSurface = 0 | |
216 | p.Size = Vector3.new(0.2, 0.2, 0.2) | |
217 | p.CustomPhysicalProperties = PhysicalProperties.new(0.01, 0, 0, 0, 0) | |
218 | local msh = Instance.new("SpecialMesh", p) | |
219 | msh.Scale = Vector3.new(-2, 2, 2) | |
220 | msh.MeshId = "http://www.roblox.com/asset/?id=188635159" | |
221 | msh.TextureId = "http://www.roblox.com/asset/?id=188539332" | |
222 | msh.VertexColor = Vector3.new(torso.BrickColor.r, torso.BrickColor.g, torso.BrickColor.b) | |
223 | local pn = Instance.new("Part", v.Character.kit) | |
224 | pn.Name = "tail" | |
225 | pn.Anchored = true | |
226 | pn.Transparency = 0 | |
227 | pn.Material = "Plastic" | |
228 | pn.CanCollide = false | |
229 | pn.TopSurface = 0 | |
230 | pn.BottomSurface = 0 | |
231 | pn.Size = Vector3.new(5, 3, 3) | |
232 | pn.CustomPhysicalProperties = PhysicalProperties.new(0.01, 0, 0, 0, 0) | |
233 | local mshn = Instance.new("SpecialMesh", pn) | |
234 | mshn.Scale = Vector3.new(2, 2, 2) | |
235 | mshn.MeshId = "http://www.roblox.com/asset/?id=188635159" | |
236 | mshn.TextureId = "http://www.roblox.com/asset/?id=188539332" | |
237 | mshn.VertexColor = Vector3.new(torso.BrickColor.r, torso.BrickColor.g, torso.BrickColor.b) | |
238 | local pn3 = Instance.new("Part", v.Character.kit) | |
239 | pn3.Name = "tail" | |
240 | pn3.Anchored = true | |
241 | pn3.Transparency = 0 | |
242 | pn3.Material = "Plastic" | |
243 | pn3.CanCollide = false | |
244 | pn3.TopSurface = 0 | |
245 | pn3.BottomSurface = 0 | |
246 | pn3.Size = Vector3.new(0.2, 0.2, 0.2) | |
247 | pn3.CustomPhysicalProperties = PhysicalProperties.new(0.01, 0, 0, 0, 0) | |
248 | local mshn3 = Instance.new("SpecialMesh", pn3) | |
249 | mshn3.Scale = Vector3.new(2, 2, 2) | |
250 | mshn3.MeshId = "http://www.roblox.com/asset/?id=188635159" | |
251 | mshn3.TextureId = "http://www.roblox.com/asset/?id=188539332" | |
252 | mshn3.VertexColor = Vector3.new(torso.BrickColor.r, torso.BrickColor.g, torso.BrickColor.b) | |
253 | local pn4 = Instance.new("Part", v.Character.kit) | |
254 | pn4.Name = "tail" | |
255 | pn4.Anchored = true | |
256 | pn4.Transparency = 0 | |
257 | pn4.Material = "Plastic" | |
258 | pn4.CanCollide = false | |
259 | pn4.TopSurface = 0 | |
260 | pn4.BottomSurface = 0 | |
261 | pn4.Size = Vector3.new(0.2, 0.2, 0.2) | |
262 | pn4.CustomPhysicalProperties = PhysicalProperties.new(0.01, 0, 0, 0, 0) | |
263 | local mshn4 = Instance.new("SpecialMesh", pn4) | |
264 | mshn4.Scale = Vector3.new(-2, 2, 2) | |
265 | mshn4.MeshId = "http://www.roblox.com/asset/?id=188635159" | |
266 | mshn4.TextureId = "http://www.roblox.com/asset/?id=188539332" | |
267 | mshn4.VertexColor = Vector3.new(torso.BrickColor.r, torso.BrickColor.g, torso.BrickColor.b) | |
268 | local pn5 = Instance.new("Part", v.Character.kit) | |
269 | pn5.Name = "tail" | |
270 | pn5.Anchored = true | |
271 | pn5.Transparency = 0 | |
272 | pn5.Material = "Plastic" | |
273 | pn5.CanCollide = false | |
274 | pn5.TopSurface = 0 | |
275 | pn5.BottomSurface = 0 | |
276 | pn5.Size = Vector3.new(0.2, 0.2, 0.2) | |
277 | pn5.CustomPhysicalProperties = PhysicalProperties.new(0.01, 0, 0, 0, 0) | |
278 | local mshn5 = Instance.new("SpecialMesh", pn5) | |
279 | mshn5.Scale = Vector3.new(2, 2, 2) | |
280 | mshn5.MeshId = "http://www.roblox.com/asset/?id=188635159" | |
281 | mshn5.TextureId = "http://www.roblox.com/asset/?id=188539332" | |
282 | mshn5.VertexColor = Vector3.new(torso.BrickColor.r, torso.BrickColor.g, torso.BrickColor.b) | |
283 | local pn6 = Instance.new("Part", v.Character.kit) | |
284 | pn6.Name = "tail" | |
285 | pn6.Anchored = true | |
286 | pn6.Transparency = 0 | |
287 | pn6.Material = "Plastic" | |
288 | pn6.CanCollide = false | |
289 | pn6.TopSurface = 0 | |
290 | pn6.BottomSurface = 0 | |
291 | pn6.Size = Vector3.new(0.2, 0.2, 0.2) | |
292 | pn6.CustomPhysicalProperties = PhysicalProperties.new(0.01, 0, 0, 0, 0) | |
293 | local mshn6 = Instance.new("SpecialMesh", pn6) | |
294 | mshn6.Scale = Vector3.new(2, 2, 2) | |
295 | mshn6.MeshId = "http://www.roblox.com/asset/?id=188635159" | |
296 | mshn6.TextureId = "http://www.roblox.com/asset/?id=188539332" | |
297 | mshn6.VertexColor = Vector3.new(torso.BrickColor.r, torso.BrickColor.g, torso.BrickColor.b) | |
298 | local pn7 = Instance.new("Part", v.Character.kit) | |
299 | pn7.Name = "tail" | |
300 | pn7.Anchored = true | |
301 | pn7.Transparency = 0 | |
302 | pn7.Material = "Plastic" | |
303 | pn7.CanCollide = false | |
304 | pn7.TopSurface = 0 | |
305 | pn7.BottomSurface = 0 | |
306 | pn7.Size = Vector3.new(0.2, 0.2, 0.2) | |
307 | pn7.CustomPhysicalProperties = PhysicalProperties.new(0.01, 0, 0, 0, 0) | |
308 | local mshn7 = Instance.new("SpecialMesh", pn7) | |
309 | mshn7.Scale = Vector3.new(2, 2, 2) | |
310 | mshn7.MeshId = "http://www.roblox.com/asset/?id=188635159" | |
311 | mshn7.TextureId = "http://www.roblox.com/asset/?id=188539332" | |
312 | mshn7.VertexColor = Vector3.new(torso.BrickColor.r, torso.BrickColor.g, torso.BrickColor.b) | |
313 | local pn8 = Instance.new("Part", v.Character.kit) | |
314 | pn8.Name = "tail" | |
315 | pn8.Anchored = true | |
316 | pn8.Transparency = 0 | |
317 | pn8.Material = "Plastic" | |
318 | pn8.CanCollide = false | |
319 | pn8.TopSurface = 0 | |
320 | pn8.BottomSurface = 0 | |
321 | pn8.Size = Vector3.new(0.2, 0.2, 0.2) | |
322 | pn8.CustomPhysicalProperties = PhysicalProperties.new(0.01, 0, 0, 0, 0) | |
323 | local mshn8 = Instance.new("SpecialMesh", pn8) | |
324 | mshn8.Scale = Vector3.new(-2, 2, 2) | |
325 | mshn8.MeshId = "http://www.roblox.com/asset/?id=188635159" | |
326 | mshn8.TextureId = "http://www.roblox.com/asset/?id=188539332" | |
327 | mshn8.VertexColor = Vector3.new(torso.BrickColor.r, torso.BrickColor.g, torso.BrickColor.b) | |
328 | local pn9 = Instance.new("Part", v.Character.kit) | |
329 | pn9.Name = "tail" | |
330 | pn9.Anchored = true | |
331 | pn9.Transparency = 0 | |
332 | pn9.Material = "Plastic" | |
333 | pn9.CanCollide = false | |
334 | pn9.TopSurface = 0 | |
335 | pn9.BottomSurface = 0 | |
336 | pn9.Size = Vector3.new(0.2, 0.2, 0.2) | |
337 | pn9.CustomPhysicalProperties = PhysicalProperties.new(0.01, 0, 0, 0, 0) | |
338 | local mshn9 = Instance.new("SpecialMesh", pn9) | |
339 | mshn9.Scale = Vector3.new(-2, 2, 2) | |
340 | mshn9.MeshId = "http://www.roblox.com/asset/?id=188635159" | |
341 | mshn9.TextureId = "http://www.roblox.com/asset/?id=188539332" | |
342 | mshn9.VertexColor = Vector3.new(torso.BrickColor.r, torso.BrickColor.g, torso.BrickColor.b) | |
343 | local pn0 = Instance.new("Part", v.Character.kit) | |
344 | pn0.Name = "ears" | |
345 | pn0.Anchored = true | |
346 | pn0.Transparency = 0 | |
347 | pn0.Material = "Plastic" | |
348 | pn0.CanCollide = false | |
349 | pn0.TopSurface = 0 | |
350 | pn0.BottomSurface = 0 | |
351 | pn0.Size = Vector3.new(0.2, 0.2, 0.2) | |
352 | pn0.CustomPhysicalProperties = PhysicalProperties.new(0.01, 0, 0, 0, 0) | |
353 | local mshn0 = Instance.new("SpecialMesh", pn0) | |
354 | mshn0.Scale = Vector3.new(0.5, 0.5, 0.5) | |
355 | mshn0.MeshId = "http://www.roblox.com/asset/?id=361948302" | |
356 | mshn0.TextureId = "http://www.roblox.com/asset/?id=50657528" | |
357 | mshn0.VertexColor = Vector3.new(torso.BrickColor.r, torso.BrickColor.g, torso.BrickColor.b) | |
358 | p.Anchored = false | |
359 | local motor1 = Instance.new("Weld", p) | |
360 | motor1.Part0 = p | |
361 | motor1.Part1 = torso | |
362 | motor1.C0 = CFrame.new(2.36, -1.8, -0.87) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)) | |
363 | motor1.C1 = CFrame.new(0, -1, 0.5) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)) | |
364 | pn.Anchored = false | |
365 | local motor2 = Instance.new("Weld", pn) | |
366 | motor2.Part0 = pn | |
367 | motor2.Part1 = torso | |
368 | motor2.C0 = CFrame.new(-2.36, -1.8, -0.87) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)) | |
369 | motor2.C1 = CFrame.new(0, -1, 0.5) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)) | |
370 | pn3.Anchored = false | |
371 | local motor3 = Instance.new("Weld", pn3) | |
372 | motor3.Part0 = pn3 | |
373 | motor3.Part1 = torso | |
374 | motor3.C0 = CFrame.new(-2.36, -1.8, -0.87) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)) | |
375 | motor3.C1 = CFrame.new(0, -1, 0.5) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)) | |
376 | pn4.Anchored = false | |
377 | local motor4 = Instance.new("Weld", pn4) | |
378 | motor4.Part0 = pn4 | |
379 | motor4.Part1 = torso | |
380 | motor4.C0 = CFrame.new(2.36, -1.8, -0.87) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)) | |
381 | motor4.C1 = CFrame.new(0, -1, 0.5) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)) | |
382 | pn5.Anchored = false | |
383 | local motor5 = Instance.new("Weld", pn5) | |
384 | motor5.Part0 = pn5 | |
385 | motor5.Part1 = torso | |
386 | motor5.C0 = CFrame.new(-2.36, -1.8, -0.87) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)) | |
387 | motor5.C1 = CFrame.new(0, -1, 0.5) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)) | |
388 | pn6.Anchored = false | |
389 | local motor6 = Instance.new("Weld", pn6) | |
390 | motor6.Part0 = pn6 | |
391 | motor6.Part1 = torso | |
392 | motor6.C0 = CFrame.new(-2.36, -1.8, -0.87) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)) | |
393 | motor6.C1 = CFrame.new(0, -1, 0.5) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)) | |
394 | pn7.Anchored = false | |
395 | local motor7 = Instance.new("Weld", pn7) | |
396 | motor7.Part0 = pn7 | |
397 | motor7.Part1 = torso | |
398 | motor7.C0 = CFrame.new(-2.36, -1.8, -0.87) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)) | |
399 | motor7.C1 = CFrame.new(0, -1, 0.5) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)) | |
400 | pn8.Anchored = false | |
401 | local motor8 = Instance.new("Weld", pn8) | |
402 | motor8.Part0 = pn8 | |
403 | motor8.Part1 = torso | |
404 | motor8.C0 = CFrame.new(2.36, -1.8, -0.87) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)) | |
405 | motor8.C1 = CFrame.new(0, -1, 0.5) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)) | |
406 | pn9.Anchored = false | |
407 | local motor9 = Instance.new("Weld", pn9) | |
408 | motor9.Part0 = pn9 | |
409 | motor9.Part1 = torso | |
410 | motor9.C0 = CFrame.new(2.36, -1.8, -0.87) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)) | |
411 | motor9.C1 = CFrame.new(0, -1, 0.5) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)) | |
412 | pn0.Anchored = false | |
413 | local motor0 = Instance.new("Weld", pn0) | |
414 | motor0.Part0 = pn0 | |
415 | motor0.Part1 = v.Character.Head | |
416 | motor0.C0 = CFrame.new(0, -0.8, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)) | |
417 | game:GetService("RunService").Stepped:connect(function() | |
418 | Torsovelocity = (RootPart.Velocity * Vector3.new(1, 0, 1)).magnitude | |
419 | velocity = RootPart.Velocity.y | |
420 | sine = sine + change | |
421 | local hit, pos = rayCast(RootPart.Position, CFrame.new(RootPart.Position, RootPart.Position - Vector3.new(0, 1, 0)).lookVector, 4, Character) | |
422 | if equipped == true or equipped == false then | |
423 | if RootPart.Velocity.y > 1 and hit == nil then | |
424 | Anim = "Jump" | |
425 | if attack == false then | |
426 | motor1.C0 = clerp(motor1.C0, CFrame.new(2.36, -1.8, -0.87) * angles(math.rad(-60 + 0 * math.cos(sine / 10)), math.rad(-90 + 0 * math.cos(sine / 10)), math.rad(80 + 0 * math.cos(sine / 25))), 0.1) | |
427 | motor2.C0 = clerp(motor2.C0, CFrame.new(-2.36, -1.8, -0.87) * angles(math.rad(-60 + 0 * math.cos(sine / 10)), math.rad(90 + 0 * math.cos(sine / 10)), math.rad(-80 + 0 * math.cos(sine / 25))), 0.1) | |
428 | motor3.C0 = clerp(motor3.C0, CFrame.new(-2.36, -1.8, -0.87) * angles(math.rad(-60 + 0 * math.cos(sine / 10)), math.rad(90 + 0 * math.cos(sine / 10)), math.rad(-110 + 0 * math.cos(sine / 25))), 0.1) | |
429 | motor4.C0 = clerp(motor4.C0, CFrame.new(2.36, -1.8, -0.87) * angles(math.rad(-60 + 0 * math.cos(sine / 10)), math.rad(-90 + 0 * math.cos(sine / 10)), math.rad(110 + 0 * math.cos(sine / 25))), 0.1) | |
430 | motor5.C0 = clerp(motor5.C0, CFrame.new(-2.36, -1.8, -0.87) * angles(math.rad(-60 + 0 * math.cos(sine / 10)), math.rad(90 + 0 * math.cos(sine / 10)), math.rad(-80 + 0 * math.cos(sine / 25))), 0.1) | |
431 | motor6.C0 = clerp(motor6.C0, CFrame.new(-2.36, -1.8, -0.87) * angles(math.rad(-60 + 0 * math.cos(sine / 10)), math.rad(90 + 0 * math.cos(sine / 10)), math.rad(-80 + 0 * math.cos(sine / 25))), 0.1) | |
432 | motor7.C0 = clerp(motor7.C0, CFrame.new(-2.36, -1.8, -0.87) * angles(math.rad(-60 + 0 * math.cos(sine / 10)), math.rad(90 + 0 * math.cos(sine / 10)), math.rad(-80 + 0 * math.cos(sine / 25))), 0.1) | |
433 | motor8.C0 = clerp(motor8.C0, CFrame.new(2.36, -1.8, -0.87) * angles(math.rad(-60 + 0 * math.cos(sine / 10)), math.rad(-90 + 0 * math.cos(sine / 10)), math.rad(80 + 0 * math.cos(sine / 25))), 0.1) | |
434 | motor9.C0 = clerp(motor9.C0, CFrame.new(2.36, -1.8, -0.87) * angles(math.rad(-60 + 0 * math.cos(sine / 10)), math.rad(-90 + 0 * math.cos(sine / 10)), math.rad(80 + 0 * math.cos(sine / 25))), 0.1) | |
435 | end | |
436 | else | |
437 | if RootPart.Velocity.y < -1 and hit == nil then | |
438 | Anim = "Fall" | |
439 | if attack == false then | |
440 | motor1.C0 = clerp(motor1.C0, CFrame.new(2.36, -1.8, -0.87) * angles(math.rad(-45 + 0 * math.cos(sine / 10)), math.rad(0 + 0 * math.cos(sine / 10)), math.rad(70 + 0 * math.cos(sine / 25))), 0.1) | |
441 | motor2.C0 = clerp(motor2.C0, CFrame.new(-2.36, -1.8, -0.87) * angles(math.rad(-45 + 0 * math.cos(sine / 10)), math.rad(0 + 0 * math.cos(sine / 10)), math.rad(-70 + 0 * math.cos(sine / 25))), 0.1) | |
442 | motor3.C0 = clerp(motor3.C0, CFrame.new(-2.36, -1.8, -0.87) * angles(math.rad(-45 + 0 * math.cos(sine / 10)), math.rad(0 + 0 * math.cos(sine / 10)), math.rad(-70 + 0 * math.cos(sine / 25))), 0.1) | |
443 | motor4.C0 = clerp(motor4.C0, CFrame.new(2.36, -1.8, -0.87) * angles(math.rad(-45 + 0 * math.cos(sine / 10)), math.rad(0 + 0 * math.cos(sine / 10)), math.rad(70 + 0 * math.cos(sine / 25))), 0.1) | |
444 | motor5.C0 = clerp(motor5.C0, CFrame.new(-2.36, -1.8, -0.87) * angles(math.rad(-45 + 0 * math.cos(sine / 10)), math.rad(0 + 0 * math.cos(sine / 10)), math.rad(-70 + 0 * math.cos(sine / 25))), 0.1) | |
445 | motor6.C0 = clerp(motor6.C0, CFrame.new(-2.36, -1.8, -0.87) * angles(math.rad(-45 + 0 * math.cos(sine / 10)), math.rad(0 + 0 * math.cos(sine / 10)), math.rad(-70 + 0 * math.cos(sine / 25))), 0.1) | |
446 | motor7.C0 = clerp(motor7.C0, CFrame.new(-2.36, -1.8, -0.87) * angles(math.rad(-45 + 0 * math.cos(sine / 10)), math.rad(0 + 0 * math.cos(sine / 10)), math.rad(-70 + 0 * math.cos(sine / 25))), 0.1) | |
447 | motor8.C0 = clerp(motor8.C0, CFrame.new(2.36, -1.8, -0.87) * angles(math.rad(-45 + 0 * math.cos(sine / 10)), math.rad(0 + 0 * math.cos(sine / 10)), math.rad(70 + 0 * math.cos(sine / 25))), 0.1) | |
448 | motor9.C0 = clerp(motor9.C0, CFrame.new(2.36, -1.8, -0.87) * angles(math.rad(-45 + 0 * math.cos(sine / 10)), math.rad(0 + 0 * math.cos(sine / 10)), math.rad(70 + 0 * math.cos(sine / 25))), 0.1) | |
449 | end | |
450 | else | |
451 | if Torsovelocity < 1 and hit ~= nil then | |
452 | Anim = "Idle" | |
453 | if attack == false then | |
454 | change = 1 | |
455 | motor1.C0 = clerp(motor1.C0, CFrame.new(2.36, -1.8, -0.87) * angles(math.rad(-5 + 5 * math.cos(sine / 50)), math.rad(0 + 5 * math.cos(sine / 80)), math.rad(0 + 0 * math.cos(sine / 25))), 0.1) | |
456 | motor2.C0 = clerp(motor2.C0, CFrame.new(-2.36, -1.8, -0.87) * angles(math.rad(-5 + -5 * math.cos(sine / 70)), math.rad(0 + -5 * math.cos(sine / 50)), math.rad(0 + 0 * math.cos(sine / 25))), 0.1) | |
457 | motor3.C0 = clerp(motor3.C0, CFrame.new(-2.36, -1.8, -0.87) * angles(math.rad(-5 + -5 * math.cos(sine / 80)), math.rad(0 + 5 * math.cos(sine / 65)), math.rad(-50 + 0 * math.cos(sine / 25))), 0.1) | |
458 | motor4.C0 = clerp(motor4.C0, CFrame.new(2.36, -1.8, -0.87) * angles(math.rad(0 + 5 * math.cos(sine / 40)), math.rad(0 + 5 * math.cos(sine / 70)), math.rad(-40 + 0 * math.cos(sine / 25))), 0.1) | |
459 | motor5.C0 = clerp(motor5.C0, CFrame.new(-2.36, -1.8, -0.87) * angles(math.rad(0 + 5 * math.cos(sine / 60)), math.rad(0 + 5 * math.cos(sine / 65)), math.rad(40 + 0 * math.cos(sine / 25))), 0.1) | |
460 | motor6.C0 = clerp(motor6.C0, CFrame.new(-2.36, -1.8, -0.87) * angles(math.rad(-50 + 5 * math.cos(sine / 35)), math.rad(0 + 5 * math.cos(sine / 70)), math.rad(0 + 0 * math.cos(sine / 25))), 0.1) | |
461 | motor7.C0 = clerp(motor7.C0, CFrame.new(-2.36, -1.8, -0.87) * angles(math.rad(-50 + 5 * math.cos(sine / 70)), math.rad(0 + 5 * math.cos(sine / 35)), math.rad(-45 + 0 * math.cos(sine / 25))), 0.1) | |
462 | motor8.C0 = clerp(motor8.C0, CFrame.new(2.36, -1.8, -0.87) * angles(math.rad(-50 + 5 * math.cos(sine / 55)), math.rad(0 + 5 * math.cos(sine / 55)), math.rad(-10 + 0 * math.cos(sine / 25))), 0.1) | |
463 | motor9.C0 = clerp(motor9.C0, CFrame.new(2.36, -1.8, -0.87) * angles(math.rad(-50 + 5 * math.cos(sine / 65)), math.rad(0 + 5 * math.cos(sine / 60)), math.rad(35 + 0 * math.cos(sine / 25))), 0.1) | |
464 | end | |
465 | else | |
466 | if Torsovelocity > 2 and hit ~= nil then | |
467 | Anim = "Walk" | |
468 | if attack == false then | |
469 | motor1.C0 = clerp(motor1.C0, CFrame.new(2.36, -1.8, -0.87) * angles(math.rad(-60 + -10 * math.cos(sine / 10)), math.rad(-45 + 10 * math.cos(sine / 10)), math.rad(45 + 0 * math.cos(sine / 10))), 0.1) | |
470 | motor2.C0 = clerp(motor2.C0, CFrame.new(-2.36, -1.8, -0.87) * angles(math.rad(-60 + 10 * math.cos(sine / 10)), math.rad(45 + 10 * math.cos(sine / 10)), math.rad(-45 + 0 * math.cos(sine / 10))), 0.1) | |
471 | motor3.C0 = clerp(motor3.C0, CFrame.new(-2.36, -1.8, -0.87) * angles(math.rad(-60 + 10 * math.cos(sine / 10)), math.rad(45 + 10 * math.cos(sine / 10)), math.rad(-45 + 0 * math.cos(sine / 10))), 0.1) | |
472 | motor4.C0 = clerp(motor4.C0, CFrame.new(2.36, -1.8, -0.87) * angles(math.rad(-60 + -10 * math.cos(sine / 10)), math.rad(-45 + 10 * math.cos(sine / 10)), math.rad(45 + 0 * math.cos(sine / 10))), 0.1) | |
473 | motor5.C0 = clerp(motor5.C0, CFrame.new(-2.36, -1.8, -0.87) * angles(math.rad(-60 + 10 * math.cos(sine / 10)), math.rad(45 + 10 * math.cos(sine / 10)), math.rad(-45 + 0 * math.cos(sine / 10))), 0.1) | |
474 | motor6.C0 = clerp(motor6.C0, CFrame.new(-2.36, -1.8, -0.87) * angles(math.rad(-60 + 10 * math.cos(sine / 10)), math.rad(45 + 10 * math.cos(sine / 10)), math.rad(-45 + 0 * math.cos(sine / 10))), 0.1) | |
475 | motor7.C0 = clerp(motor7.C0, CFrame.new(-2.36, -1.8, -0.87) * angles(math.rad(-60 + 10 * math.cos(sine / 10)), math.rad(45 + 10 * math.cos(sine / 10)), math.rad(-45 + 0 * math.cos(sine / 10))), 0.1) | |
476 | motor8.C0 = clerp(motor8.C0, CFrame.new(2.36, -1.8, -0.87) * angles(math.rad(-60 + -10 * math.cos(sine / 10)), math.rad(-45 + 10 * math.cos(sine / 10)), math.rad(45 + 0 * math.cos(sine / 10))), 0.1) | |
477 | motor9.C0 = clerp(motor9.C0, CFrame.new(2.36, -1.8, -0.87) * angles(math.rad(-60 + -10 * math.cos(sine / 10)), math.rad(-45 + 10 * math.cos(sine / 10)), math.rad(45 + 0 * math.cos(sine / 10))), 0.1) | |
478 | end | |
479 | end | |
480 | end | |
481 | end | |
482 | end | |
483 | end | |
484 | end) |