SHOW:
|
|
- or go back to the newest paste.
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 | 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 | print([[ | |
88 | ___________________________________ | |
89 | ||
90 | Booty Offender // A Kyutatsuki13's script | |
91 | Build 0001 | |
92 | Credit to Ethanhong that gave me this idea ;) | |
93 | https://discord.gg/DueqyJ8 | |
94 | ||
95 | ___________________________________ | |
96 | ]]) | |
97 | ||
98 | - | warn("You're whitelisted, "..game:GetService("Players").LocalPlayer.Name.." :)") |
98 | + | warn("You're whitelisted, "..owner.." :)") |
99 | ||
100 | local p = owner | |
101 | local char = p.Character | |
102 | local larm = char:WaitForChild("Left Arm") | |
103 | local rarm = char:WaitForChild("Right Arm") | |
104 | local lleg = char:WaitForChild("Left Leg") | |
105 | local rleg = char:WaitForChild("Right Leg") | |
106 | local hed = char:WaitForChild("Head") | |
107 | local torso = char:WaitForChild("Torso") | |
108 | local root = char:WaitForChild("HumanoidRootPart") | |
109 | local hum = char:FindFirstChildOfClass("Humanoid") | |
110 | local debris = game:GetService("Debris") | |
111 | local input = game:GetService("UserInputService") | |
112 | local run = game:GetService("RunService") | |
113 | local rs = run.RenderStepped | |
114 | local wingpose = "Idle" | |
115 | local DebrisModel = Instance.new("Model",char) | |
116 | DebrisModel.Name = "Debris" | |
117 | repeat rs:wait() until p.CharacterAppearanceLoaded | |
118 | ||
119 | noidle = false | |
120 | shift = false | |
121 | control = false | |
122 | ||
123 | ---------------------------------------------------------------------------- | |
124 | ||
125 | function rswait(value) | |
126 | if value ~= nil and value ~= 0 then | |
127 | for i=1,value do | |
128 | rs:wait() | |
129 | end | |
130 | else | |
131 | rs:wait() | |
132 | end | |
133 | end | |
134 | ||
135 | ---------------------------------------------------------------------------- | |
136 | ||
137 | local timeposition = 0 | |
138 | ||
139 | function music(id) | |
140 | if id == "Stop" then | |
141 | if not torso:FindFirstChild("MusicRuin") then | |
142 | soundz = Instance.new("Sound",torso) | |
143 | end | |
144 | soundz:Stop() | |
145 | else | |
146 | if not torso:FindFirstChild("MusicRuin") then | |
147 | soundz = Instance.new("Sound",torso) | |
148 | for i=1,2 do | |
149 | local equalizer = Instance.new("EqualizerSoundEffect",soundz) | |
150 | equalizer.HighGain = 6 | |
151 | equalizer.MidGain = 0 | |
152 | equalizer.LowGain = 6 | |
153 | end | |
154 | end | |
155 | soundz.Volume = 10 | |
156 | soundz.Name = "MusicRuin" | |
157 | soundz.Looped = true | |
158 | soundz.PlaybackSpeed = 1 | |
159 | soundz.SoundId = "rbxassetid://"..id | |
160 | soundz:Stop() | |
161 | soundz:Play() | |
162 | end | |
163 | end | |
164 | ||
165 | ---------------------------------------------------------------------------- | |
166 | ||
167 | function lerp(a, b, t) | |
168 | return a + (b - a)*t | |
169 | end | |
170 | ||
171 | ---------------------------------------------------------------------------- | |
172 | ||
173 | function Lerp(c1,c2,al) | |
174 | local com1 = {c1.X,c1.Y,c1.Z,c1:toEulerAnglesXYZ()} | |
175 | local com2 = {c2.X,c2.Y,c2.Z,c2:toEulerAnglesXYZ()} | |
176 | for i,v in pairs(com1) do | |
177 | com1[i] = v+(com2[i]-v)*al | |
178 | end | |
179 | return CFrame.new(com1[1],com1[2],com1[3]) * CFrame.Angles(select(4,unpack(com1))) | |
180 | end | |
181 | ||
182 | ---------------------------------------------------------------------------- | |
183 | ||
184 | function slerp(a, b, t) | |
185 | dot = a:Dot(b) | |
186 | if dot > 0.99999 or dot < -0.99999 then | |
187 | return t <= 0.5 and a or b | |
188 | else | |
189 | r = math.acos(dot) | |
190 | return (a*math.sin((1 - t)*r) + b*math.sin(t*r)) / math.sin(r) | |
191 | end | |
192 | end | |
193 | ||
194 | ---------------------------------------------------------------------------- | |
195 | ||
196 | function clerp(c1,c2,al) | |
197 | ||
198 | local com1 = {c1.X,c1.Y,c1.Z,c1:toEulerAnglesXYZ()} | |
199 | ||
200 | local com2 = {c2.X,c2.Y,c2.Z,c2:toEulerAnglesXYZ()} | |
201 | ||
202 | for i,v in pairs(com1) do | |
203 | ||
204 | com1[i] = lerp(v,com2[i],al) | |
205 | ||
206 | end | |
207 | ||
208 | return CFrame.new(com1[1],com1[2],com1[3]) * CFrame.Angles(select(4,unpack(com1))) | |
209 | ||
210 | end | |
211 | ||
212 | ---------------------------------------------------------------------------- | |
213 | ||
214 | function findAllNearestTorso(pos,dist) | |
215 | local list = workspace:children() | |
216 | local torso = {} | |
217 | local temp = nil | |
218 | local human = nil | |
219 | local temp2 = nil | |
220 | for x = 1, #list do | |
221 | temp2 = list[x] | |
222 | if (temp2.className == "Model") and (temp2 ~= char) then | |
223 | temp = temp2:findFirstChild("Torso") | |
224 | human = temp2:findFirstChildOfClass("Humanoid") | |
225 | if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then | |
226 | if (temp.Position - pos).magnitude < dist then | |
227 | table.insert(torso,temp) | |
228 | dist = (temp.Position - pos).magnitude | |
229 | end | |
230 | end | |
231 | end | |
232 | end | |
233 | return torso | |
234 | end | |
235 | ||
236 | ---------------------------------------------------------------------------- | |
237 | ||
238 | function checkIfNotPlayer(model) | |
239 | if model.CanCollide == true and model ~= char and model.Parent ~= char and model.Parent.Parent ~= char and model.Parent.Parent ~= char and model.Parent ~= DebrisModel and model.Parent.Parent ~= DebrisModel and model.Parent.Parent.Parent ~= DebrisModel and model ~= wings and model.Parent ~= wings and model.Parent.Parent ~= wings then | |
240 | return true | |
241 | else | |
242 | return false | |
243 | end | |
244 | end | |
245 | ||
246 | ---------------------------------------------------------------------------- | |
247 | ||
248 | function newWeld(wp0, wp1, wc0x, wc0y, wc0z) | |
249 | ||
250 | local wld = Instance.new("Weld", wp1) | |
251 | ||
252 | wld.Part0 = wp0 | |
253 | ||
254 | wld.Part1 = wp1 | |
255 | ||
256 | wld.C0 = CFrame.new(wc0x, wc0y, wc0z) | |
257 | ||
258 | return wld | |
259 | ||
260 | end | |
261 | ||
262 | function weld(model) | |
263 | local parts,last = {} | |
264 | local function scan(parent) | |
265 | for _,v in pairs(parent:GetChildren()) do | |
266 | if (v:IsA("BasePart")) then | |
267 | if (last) then | |
268 | local w = Instance.new("Weld") | |
269 | w.Name = ("%s_Weld"):format(v.Name) | |
270 | w.Part0,w.Part1 = last,v | |
271 | w.C0 = last.CFrame:inverse() | |
272 | w.C1 = v.CFrame:inverse() | |
273 | w.Parent = last | |
274 | end | |
275 | last = v | |
276 | table.insert(parts,v) | |
277 | end | |
278 | scan(v) | |
279 | end | |
280 | end | |
281 | scan(model) | |
282 | for _,v in pairs(parts) do | |
283 | v.Anchored = false | |
284 | v.Locked = true | |
285 | v.Anchored = false | |
286 | v.BackSurface = Enum.SurfaceType.SmoothNoOutlines | |
287 | v.BottomSurface = Enum.SurfaceType.SmoothNoOutlines | |
288 | v.FrontSurface = Enum.SurfaceType.SmoothNoOutlines | |
289 | v.LeftSurface = Enum.SurfaceType.SmoothNoOutlines | |
290 | v.RightSurface = Enum.SurfaceType.SmoothNoOutlines | |
291 | v.TopSurface = Enum.SurfaceType.SmoothNoOutlines | |
292 | v.CustomPhysicalProperties = PhysicalProperties.new(0,0,0) | |
293 | end | |
294 | end | |
295 | ||
296 | ---------------------------------------------------------------------------- | |
297 | ||
298 | function calculate(part,asd) | |
299 | local Head = hed | |
300 | local RightShoulder = asd | |
301 | local RightArm = part | |
302 | local MousePosition = mouse.Hit.p | |
303 | local ToMouse = (MousePosition - Head.Position).unit | |
304 | local Angle = math.acos(ToMouse:Dot(Vector3.new(0, 1, 0))) | |
305 | local FromRightArmPos = (Head.Position + Head.CFrame:vectorToWorldSpace(Vector3.new(((Head.Size.X / 2) + (RightArm.Size.X / 2)), ((Head.Size.Y / 2) - (RightArm.Size.Z / 2)), 0))) | |
306 | local ToMouseRightArm = ((MousePosition - FromRightArmPos) * Vector3.new(1 ,0, 1)).unit | |
307 | local Look = (Head.CFrame.lookVector * Vector3.new(1, 0, 1)).unit | |
308 | local LateralAngle = math.acos(ToMouseRightArm:Dot(Look)) | |
309 | if tostring(LateralAngle) == "-1.#IND" then | |
310 | LateralAngle = 0 | |
311 | end | |
312 | local Cross = Head.CFrame.lookVector:Cross(ToMouseRightArm) | |
313 | if LateralAngle > (math.pi / 2) then | |
314 | LateralAngle = (math.pi / 2) | |
315 | local Torso = root | |
316 | local Point = Torso.CFrame:vectorToObjectSpace(mouse.Hit.p-Torso.CFrame.p) | |
317 | if Point.Z > 0 then | |
318 | if Point.X > -0 and RightArm == rarm then | |
319 | Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(mouse.Hit.X,Torso.Position.Y,mouse.Hit.Z))*CFrame.Angles(0,math.rad(110),0) | |
320 | elseif Point.X < 0 and RightArm == rarm then | |
321 | Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(mouse.Hit.X,Torso.Position.Y,mouse.Hit.Z))*CFrame.Angles(0,math.rad(-110),0) | |
322 | end | |
323 | end | |
324 | end | |
325 | if Cross.Y < 0 then | |
326 | LateralAngle = -LateralAngle | |
327 | end | |
328 | return(CFrame.Angles(((math.pi / 2) - Angle), ((math.pi / 2) + LateralAngle), math.pi/2)) | |
329 | end | |
330 | ||
331 | ---------------------------------------------------------------------------- | |
332 | ||
333 | function sound(id,position,vol,pitch,start,finish) | |
334 | coroutine.resume(coroutine.create(function() | |
335 | ||
336 | local part = Instance.new("Part",workspace) | |
337 | part.Position = position | |
338 | part.Size = Vector3.new(0,0,0) | |
339 | part.CanCollide = false | |
340 | part.Transparency = 1 | |
341 | ||
342 | local sound = Instance.new("Sound",part) | |
343 | ||
344 | sound.SoundId = "rbxassetid://"..id | |
345 | ||
346 | repeat rs:wait() until sound.IsLoaded | |
347 | ||
348 | if vol ~= nil then | |
349 | sound.Volume = vol | |
350 | end | |
351 | ||
352 | if pitch ~= nil then | |
353 | sound.PlaybackSpeed = pitch | |
354 | end | |
355 | ||
356 | if start ~= nil then | |
357 | sound.TimePosition = start | |
358 | end | |
359 | ||
360 | if finish ~= nil then | |
361 | debris:AddItem(part,finish-start) | |
362 | else | |
363 | debris:AddItem(part,sound.TimeLength) | |
364 | end | |
365 | ||
366 | sound:Play() | |
367 | ||
368 | return sound | |
369 | ||
370 | end)) | |
371 | end | |
372 | ||
373 | ---------------------------------------------------------------------------- | |
374 | ||
375 | function computeDirection(vec) | |
376 | local lenSquared = vec.magnitude * vec.magnitude | |
377 | local invSqrt = 1 / math.sqrt(lenSquared) | |
378 | return Vector3.new(vec.x * invSqrt, vec.y * invSqrt, vec.z * invSqrt) | |
379 | end | |
380 | ||
381 | ---------------------------------------------------------------------------- | |
382 | ||
383 | local shaking = 0 | |
384 | function shake(num) if num > shaking then shaking = num end end | |
385 | game:GetService("RunService").RenderStepped:connect(function() | |
386 | hum.CameraOffset = Vector3.new(math.random(-1,1),math.random(-1,1),math.random(-1,1))*(shaking/100) | |
387 | if shaking > 0 then shaking = shaking - 1 else shaking = 0 end | |
388 | end) | |
389 | ||
390 | DebrisModel = Instance.new("Model",plr.Character) | |
391 | DebrisModel.Name = "DebrisModel" | |
392 | ||
393 | function Effect(mesh,size,transparency,material,color,position,rotation,positionchange,sizechange,rotationchange,transparencychange,acceleration) | |
394 | ||
395 | local part = Instance.new("Part",DebrisModel) | |
396 | part.Anchored = true | |
397 | part.CanCollide = false | |
398 | part.Size = Vector3.new(1,1,1) | |
399 | part.Transparency = transparency | |
400 | part.Material = material | |
401 | part.Color = color | |
402 | part.CFrame = CFrame.new(position)*CFrame.Angles(math.rad(rotation.X),math.rad(rotation.Y),math.rad(rotation.Z)) | |
403 | ||
404 | local partmesh = Instance.new("SpecialMesh",part) | |
405 | if tonumber(mesh) == nil then partmesh.MeshType = mesh else partmesh.MeshId = "rbxassetid://"..mesh end | |
406 | partmesh.Scale = size | |
407 | ||
408 | local pvalue = Instance.new("Vector3Value",part) | |
409 | pvalue.Name = "Position" | |
410 | pvalue.Value = positionchange | |
411 | ||
412 | local svalue = Instance.new("Vector3Value",part) | |
413 | svalue.Name = "Size" | |
414 | svalue.Value = sizechange | |
415 | ||
416 | local rvalue = Instance.new("Vector3Value",part) | |
417 | rvalue.Name = "Rotation" | |
418 | rvalue.Value = rotationchange | |
419 | ||
420 | local tvalue = Instance.new("NumberValue",part) | |
421 | tvalue.Name = "Transparency" | |
422 | tvalue.Value = transparencychange | |
423 | ||
424 | local avalue = Instance.new("NumberValue",part) | |
425 | avalue.Name = "Acceleration" | |
426 | avalue.Value = acceleration | |
427 | ||
428 | part.Name = "EFFECT" | |
429 | ||
430 | return part | |
431 | ||
432 | end | |
433 | ||
434 | game:GetService("RunService").RenderStepped:connect(function() | |
435 | coroutine.resume(coroutine.create(function() | |
436 | ||
437 | for i, v in pairs(DebrisModel:GetChildren()) do | |
438 | if v:isA("BasePart") then | |
439 | v.LocalTransparencyModifier = 0 | |
440 | end | |
441 | end | |
442 | ||
443 | if not plr.Character:FindFirstChild("DebrisModel") then | |
444 | DebrisModel = Instance.new("Model",plr.Character) | |
445 | DebrisModel.Name = "DebrisModel" | |
446 | end | |
447 | ||
448 | for i,v in pairs(DebrisModel:GetChildren()) do | |
449 | if v:IsA("BasePart") and v.Name == "EFFECT" then | |
450 | local pvalue = v:FindFirstChild("Position").Value | |
451 | local svalue = v:FindFirstChild("Size").Value | |
452 | local rvalue = v:FindFirstChild("Rotation").Value | |
453 | local tvalue = v:FindFirstChild("Transparency").Value | |
454 | local avalue = v:FindFirstChild("Acceleration").Value | |
455 | local mesh = v:FindFirstChild("Mesh") | |
456 | mesh.Scale = mesh.Scale + svalue | |
457 | v:FindFirstChild("Size").Value = v:FindFirstChild("Size").Value + (Vector3.new(1,1,1)*avalue) | |
458 | v.Transparency = v.Transparency + tvalue | |
459 | v.CFrame = CFrame.new(pvalue)*v.CFrame*CFrame.Angles(math.rad(rvalue.X),math.rad(rvalue.Y),math.rad(rvalue.Z)) | |
460 | if v.Transparency >= 1 or mesh.Scale.X < 0 or mesh.Scale.Y < 0 or mesh.Scale.Z < 0 then | |
461 | v:Destroy() | |
462 | end | |
463 | end | |
464 | end | |
465 | ||
466 | end)) | |
467 | end) | |
468 | ||
469 | local wsback = 0 | |
470 | local frozen = false | |
471 | function freeze() | |
472 | if frozen == false then | |
473 | frozen = true | |
474 | wsback = hum.WalkSpeed | |
475 | hum.WalkSpeed = 1 | |
476 | else | |
477 | frozen = false | |
478 | hum.WalkSpeed = wsback | |
479 | end | |
480 | end | |
481 | hum.WalkSpeed = 25 | |
482 | ||
483 | function Lightning(Part0,Part1,Times,Offset,Color,Thickness,Trans) | |
484 | local magz = (Part0 - Part1).magnitude | |
485 | local curpos = Part0 | |
486 | local trz = {-Offset,Offset} | |
487 | for i=1,Times do | |
488 | local li = Instance.new("Part", DebrisModel) | |
489 | li.TopSurface =0 | |
490 | li.Material = Enum.Material.Neon | |
491 | li.BottomSurface = 0 | |
492 | li.Anchored = true | |
493 | li.Locked = true | |
494 | li.Transparency = Trans or 0.4 | |
495 | li.Color = Color | |
496 | li.formFactor = "Custom" | |
497 | li.CanCollide = false | |
498 | li.Size = Vector3.new(Thickness,Thickness,magz/Times) | |
499 | local lim = Instance.new("BlockMesh",li) | |
500 | local Offzet = Vector3.new(trz[math.random(1,2)],trz[math.random(1,2)],trz[math.random(1,2)]) | |
501 | local trolpos = CFrame.new(curpos,Part1)*CFrame.new(0,0,magz/Times).p+Offzet | |
502 | if Times == i then | |
503 | local magz2 = (curpos - Part1).magnitude | |
504 | li.Size = Vector3.new(Thickness,Thickness,magz2) | |
505 | li.CFrame = CFrame.new(curpos,Part1)*CFrame.new(0,0,-magz2/2) | |
506 | else | |
507 | li.CFrame = CFrame.new(curpos,trolpos)*CFrame.new(0,0,magz/Times/2) | |
508 | end | |
509 | curpos = li.CFrame*CFrame.new(0,0,magz/Times/2).p | |
510 | li.Name = "LIGHTNING" | |
511 | end | |
512 | end | |
513 | ||
514 | ---------------------------------------------------------------------------- | |
515 | skin_color = BrickColor.new("Light orange") | |
516 | --p:ClearCharacterAppearance() | |
517 | --hed:WaitForChild("face"):Destroy() | |
518 | hed:WaitForChild("face").Texture = "rbxassetid://407320095" | |
519 | ---------------------------------------------------------------------------- | |
520 | local size = 1 | |
521 | ||
522 | newWeld(torso, larm, -1.5, 0.5, 0) | |
523 | larm.Weld.C1 = CFrame.new(0, 0.5, 0) | |
524 | newWeld(torso, rarm, 1.5, 0.5, 0) | |
525 | rarm.Weld.C1 = CFrame.new(0, 0.5, 0) | |
526 | newWeld(torso, hed, 0, 1.5, 0) | |
527 | newWeld(torso, lleg, -0.5, -1, 0) | |
528 | lleg.Weld.C1 = CFrame.new(0, 1, 0) | |
529 | newWeld(torso, rleg, 0.5, -1, 0) | |
530 | rleg.Weld.C1 = CFrame.new(0, 1, 0) | |
531 | newWeld(root, torso, 0, -1, 0) | |
532 | torso.Weld.C1 = CFrame.new(0, -1, 0) | |
533 | ||
534 | emitters={} | |
535 | ||
536 | ---------------------------------------------------------------------------------------- | |
537 | music(288494027) | |
538 | velocityYFall=0 | |
539 | velocityYFall2=0 | |
540 | velocityYFall3=0 | |
541 | velocityYFall4=0 | |
542 | neckrotY=0 | |
543 | neckrotY2=0 | |
544 | torsorotY=0 | |
545 | torsorotY2=0 | |
546 | torsoY=0 | |
547 | torsoY2=0 | |
548 | colored = 0 | |
549 | sine = 0 | |
550 | change=0.4 | |
551 | movement=10 | |
552 | timeranim=0 | |
553 | running = false | |
554 | jumped = false | |
555 | icolor=1 | |
556 | imode=false | |
557 | ||
558 | didjump = false | |
559 | jumppower = 0 | |
560 | debounceimpact = false | |
561 | ||
562 | function jumpimpact() | |
563 | if debounceimpact == false then | |
564 | debounceimpact = true | |
565 | if jumppower < -150 then jumppower = -150 end | |
566 | shake(-jumppower/5) | |
567 | for i=1,-jumppower/20 do rs:wait() | |
568 | hed.Weld.C1 = Lerp(hed.Weld.C1, CFrame.Angles(0,0,0), 0.05) | |
569 | torso.Weld.C0 = Lerp(torso.Weld.C0, CFrame.new(0, (jumppower/20)-hum.HipHeight, 0) * CFrame.Angles(math.rad(0),math.rad(0), math.rad(0)), 0.05) | |
570 | end | |
571 | debounceimpact = false | |
572 | end | |
573 | end | |
574 | ||
575 | max = 0 | |
576 | ||
577 | rs:connect(function() | |
578 | ||
579 | for i,v in pairs(DebrisModel:GetChildren()) do | |
580 | if v.Name == "LIGHTNING" then | |
581 | local vm = v:FindFirstChildOfClass("BlockMesh") | |
582 | vm.Scale = vm.Scale - Vector3.new(0.1,0.1,0) | |
583 | if vm.Scale.X <= 0 then | |
584 | v:Destroy() | |
585 | end | |
586 | end | |
587 | end | |
588 | ||
589 | if p.Character.Parent == nil then | |
590 | local model = Instance.new("Model") | |
591 | model.Name = p.Name | |
592 | p.Character = model | |
593 | for i,v in pairs(char:GetChildren()) do | |
594 | v.Parent = p.Character | |
595 | end | |
596 | end | |
597 | ||
598 | char = p.Character | |
599 | if p.Character.Parent ~= workspace then | |
600 | p.Character.Parent = workspace | |
601 | end | |
602 | for i,v in pairs(char:GetChildren()) do | |
603 | if v:IsA("Accoutrement") then | |
604 | if v.Handle:FindFirstChild("Mesh") then | |
605 | v.Handle:FindFirstChild("Mesh").Offset = Vector3.new() | |
606 | v.Handle.Transparency = 0 | |
607 | end | |
608 | elseif v:IsA("BasePart") then | |
609 | v.Anchored = false | |
610 | if v:FindFirstChildOfClass("BodyPosition") then | |
611 | v:FindFirstChildOfClass("BodyPosition"):Destroy() | |
612 | end | |
613 | if v:FindFirstChildOfClass("BodyVelocity") then | |
614 | v:FindFirstChildOfClass("BodyVelocity"):Destroy() | |
615 | end | |
616 | if v:FindFirstChildOfClass("BodyGyro") and v:FindFirstChildOfClass("BodyGyro").Name ~= "lolnochara" then | |
617 | v:FindFirstChildOfClass("BodyGyro"):Destroy() | |
618 | end | |
619 | if v:FindFirstChild("Mesh") then | |
620 | v:FindFirstChild("Mesh").Offset = Vector3.new() | |
621 | end | |
622 | if not DebrisModel:FindFirstChild(v.Name.."FORCEFIELD") then | |
623 | local force = Instance.new("Part",DebrisModel) | |
624 | force.Name = v.Name.."FORCEFIELD" | |
625 | if v ~= hed then | |
626 | force.Size = v.Size+(Vector3.new(1,1,1)*0.2) | |
627 | else | |
628 | force.Size = (Vector3.new(1,1,1)*v.Size.Y)+(Vector3.new(1,1,1)*0.2) | |
629 | end | |
630 | force.CanCollide = false | |
631 | force.Transparency = 1 | |
632 | force.Color = Color3.new(0,1,1) | |
633 | force.Material = Enum.Material.Neon | |
634 | newWeld(v,force,0,0,0) | |
635 | else | |
636 | if not DebrisModel:FindFirstChild(v.Name.."FORCEFIELD"):FindFirstChildOfClass("Weld") then | |
637 | newWeld(v,DebrisModel:FindFirstChild(v.Name.."FORCEFIELD"),0,0,0) | |
638 | end | |
639 | end | |
640 | if v.Name ~= "HumanoidRootPart" then | |
641 | v.Transparency = 0 | |
642 | else | |
643 | v.Transparency = 1 | |
644 | end | |
645 | end | |
646 | end | |
647 | ||
648 | if -root.Velocity.Y/1.5 > -5 and -root.Velocity.Y/1.5 < 150 then | |
649 | velocityYFall = root.Velocity.Y/1.5 | |
650 | else | |
651 | if -root.Velocity.Y/1.5 < -5 then | |
652 | velocityYFall = 5 | |
653 | elseif -root.Velocity.Y/1.5 > 150 then | |
654 | velocityYFall = -150 | |
655 | end | |
656 | end | |
657 | ||
658 | if -root.Velocity.Y/180 > 0 and -root.Velocity.Y/180 < 1.2 then | |
659 | velocityYFall2 = root.Velocity.Y/180 | |
660 | else | |
661 | if -root.Velocity.Y/180 < 0 then | |
662 | velocityYFall2 = 0 | |
663 | elseif -root.Velocity.Y/180 > 1.2 then | |
664 | velocityYFall2 = -1.2 | |
665 | end | |
666 | end | |
667 | ||
668 | if -root.Velocity.Y/1.5 > -5 and -root.Velocity.Y/1.5 < 50 then | |
669 | velocityYFall3 = root.Velocity.Y/1.5 | |
670 | else | |
671 | if -root.Velocity.Y/1.5 < -5 then | |
672 | velocityYFall3 = 5 | |
673 | elseif -root.Velocity.Y/1.5 > 50 then | |
674 | velocityYFall3 = -50 | |
675 | end | |
676 | end | |
677 | ||
678 | if -root.Velocity.Y/1.5 > -50 and -root.Velocity.Y/1.5 < 20 then | |
679 | velocityYFall4 = root.Velocity.Y/1.5 | |
680 | else | |
681 | if -root.Velocity.Y/180 < -5 then | |
682 | velocityYFall4 = 5 | |
683 | elseif -root.Velocity.Y/180 > 50 then | |
684 | velocityYFall4 = -50 | |
685 | end | |
686 | end | |
687 | ||
688 | if root.RotVelocity.Y/6 < 1 and root.RotVelocity.Y/6 > -1 then | |
689 | neckrotY = root.RotVelocity.Y/6 | |
690 | else | |
691 | if root.RotVelocity.Y/6 < -1 then | |
692 | neckrotY = -1 | |
693 | elseif root.RotVelocity.Y/6 > 1 then | |
694 | neckrotY = 1 | |
695 | end | |
696 | end | |
697 | ||
698 | if root.RotVelocity.Y/8 < 0.6 and root.RotVelocity.Y/8 > -0.6 then | |
699 | neckrotY2 = root.RotVelocity.Y/8 | |
700 | else | |
701 | if root.RotVelocity.Y/8 < -0.6 then | |
702 | neckrotY2 = -0.6 | |
703 | elseif root.RotVelocity.Y/8 > 0.6 then | |
704 | neckrotY2 = 0.6 | |
705 | end | |
706 | end | |
707 | ||
708 | if root.RotVelocity.Y/6 < 0.2 and root.RotVelocity.Y/6 > -0.2 then | |
709 | torsorotY = root.RotVelocity.Y/6 | |
710 | else | |
711 | if root.RotVelocity.Y/6 < -0.2 then | |
712 | torsorotY = -0.2 | |
713 | elseif root.RotVelocity.Y/6 > 0.2 then | |
714 | torsorotY = 0.2 | |
715 | end | |
716 | end | |
717 | ||
718 | if root.RotVelocity.Y/8 < 0.2 and root.RotVelocity.Y/8 > -0.2 then | |
719 | torsorotY2 = root.RotVelocity.Y/8 | |
720 | else | |
721 | if root.RotVelocity.Y/8 < -0.2 then | |
722 | torsorotY2 = -0.2 | |
723 | elseif root.RotVelocity.Y/8 > 0.2 then | |
724 | torsorotY2 = 0.2 | |
725 | end | |
726 | end | |
727 | ||
728 | torsoY = -(torso.Velocity*Vector3.new(1, 0, 1)).magnitude/20 | |
729 | torsoY2 = -(torso.Velocity*Vector3.new(1, 0, 1)).magnitude/36 | |
730 | ||
731 | local ray1 = Ray.new(root.Position+Vector3.new(size,0,0),Vector3.new(0, -4, 0)) | |
732 | local part1, endPoint = workspace:FindPartOnRay(ray1, char) | |
733 | ||
734 | local ray2 = Ray.new(root.Position-Vector3.new(size,0,0),Vector3.new(0, -4, 0)) | |
735 | local part2, endPoint = workspace:FindPartOnRay(ray2, char) | |
736 | ||
737 | local ray3 = Ray.new(root.Position+Vector3.new(0,0,size/2),Vector3.new(0, -4, 0)) | |
738 | local part3, endPoint = workspace:FindPartOnRay(ray3, char) | |
739 | ||
740 | local ray4 = Ray.new(root.Position-Vector3.new(0,0,size/2),Vector3.new(0, -4, 0)) | |
741 | local part4, endPoint = workspace:FindPartOnRay(ray4, char) | |
742 | ||
743 | local ray5 = Ray.new(root.Position+Vector3.new(size,0,size/2),Vector3.new(0, -4, 0)) | |
744 | local part5, endPoint = workspace:FindPartOnRay(ray5, char) | |
745 | ||
746 | local ray6 = Ray.new(root.Position-Vector3.new(size,0,size/2),Vector3.new(0, -4, 0)) | |
747 | local part6, endPoint = workspace:FindPartOnRay(ray6, char) | |
748 | ||
749 | local ray7 = Ray.new(root.Position+Vector3.new(size,0,-size/2),Vector3.new(0, -4, 0)) | |
750 | local part7, endPoint = workspace:FindPartOnRay(ray7, char) | |
751 | ||
752 | local ray8 = Ray.new(root.Position-Vector3.new(size,0,-size/2),Vector3.new(0, -4, 0)) | |
753 | local part8, endPoint = workspace:FindPartOnRay(ray8, char) | |
754 | ||
755 | local ray = Ray.new(root.Position,Vector3.new(0, -6, 0)) | |
756 | local part, endPoint = workspace:FindPartOnRay(ray, char) | |
757 | ||
758 | if part1 or part2 or part3 or part4 or part5 or part6 or part7 or part8 then jumped = false else endPoint = 0 jumped = true end | |
759 | ||
760 | local rlegray = Ray.new(rleg.Position+Vector3.new(0,size/2,0),Vector3.new(0, -1.75, 0)) | |
761 | local rlegpart, rlegendPoint = workspace:FindPartOnRay(rlegray, char) | |
762 | ||
763 | local llegray = Ray.new(lleg.Position+Vector3.new(0,size/2,0),Vector3.new(0, -1.75, 0)) | |
764 | local llegpart, llegendPoint = workspace:FindPartOnRay(llegray, char) | |
765 | ||
766 | if hum.Health > 0 and noidle == false then | |
767 | if hum.Sit == false then | |
768 | if (torso.Velocity*Vector3.new(1, 0, 1)).magnitude >= 5 and jumped == false then | |
769 | hed.Weld.C0 = Lerp(hed.Weld.C0, CFrame.new(0, 1.5, -.2) * CFrame.Angles(math.rad((torso.Velocity*Vector3.new(1, 0, 1)).magnitude/35),torsorotY, math.rad(0)+torsorotY), 0.4) | |
770 | hed.Weld.C1 = Lerp(hed.Weld.C1, CFrame.Angles((change/10)*math.cos(sine/2)+0.1,-(change/10)*math.cos(sine/4)-(torsorotY/5),(change/5)*math.cos(sine/4)), 0.1) | |
771 | rarm.Weld.C0 = Lerp(rarm.Weld.C0, CFrame.new(1.5,0.62-(movement/40)*math.cos(sine/4)/3,(movement/150)+(movement/40)*math.cos(sine/4))*CFrame.Angles(math.rad(-5-(movement*2)*math.cos(sine/4))+ -(movement/10)*math.sin(sine/4)*2,math.rad(0-(movement*2)*math.cos(sine/4)),math.rad(0)), 0.2) | |
772 | larm.Weld.C0 = Lerp(larm.Weld.C0, CFrame.new(-1.5,0.62+(movement/40)*math.cos(sine/4)/3,(movement/150)-(movement/40)*math.cos(sine/4))*CFrame.Angles(math.rad(-5+(movement*2)*math.cos(sine/4))+ (movement/10)*math.sin(sine/4)*2,math.rad(0-(movement*2)*math.cos(sine/4)),math.rad(0)), 0.2) | |
773 | torso.Weld.C0 = Lerp(torso.Weld.C0, CFrame.new(0, -0.5+(change*2)*math.sin(sine/2), 0) * CFrame.Angles(math.rad(30+(change*20)-(movement/20)*math.cos(sine/2)), torsorotY2+math.rad(0-20*math.sin(sine/4)), torsorotY2+math.rad(0-1*math.cos(sine/4))), 0.1) | |
774 | lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5,(-0.85-(movement/15)*math.cos(sine/4)/2),-0.1+(movement/15)*math.cos(sine/4))*CFrame.Angles(math.rad(-50+(change*5)-movement*math.cos(sine/4))+ -(movement/10)*math.sin(sine/4),math.rad(0+(movement*2)*math.cos(sine/4)),math.rad(0)), 0.2) | |
775 | rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5,(-0.85+(movement/15)*math.cos(sine/4)/2),-0.1-(movement/15)*math.cos(sine/4))*CFrame.Angles(math.rad(-50+(change*5)+movement*math.cos(sine/4))+ (movement/10)*math.sin(sine/4),math.rad(0+(movement*2)*math.cos(sine/4)),math.rad(0)), 0.2) | |
776 | elseif jumped == true then | |
777 | didjump = true | |
778 | jumppower = root.Velocity.Y | |
779 | hed.Weld.C0 = Lerp(hed.Weld.C0, CFrame.new(0, 1.5, -.1) * CFrame.Angles(0,0,0), 0.4) | |
780 | hed.Weld.C1 = Lerp(hed.Weld.C1, CFrame.Angles(0,0,0), 0.1) | |
781 | larm.Weld.C0 = Lerp(larm.Weld.C0, CFrame.new(-1.5,0.55,0) * CFrame.Angles(math.rad(0),math.rad(0), math.rad(0)), 0.1) | |
782 | rarm.Weld.C0 = Lerp(rarm.Weld.C0, CFrame.new(1.5,0.55,0) * CFrame.Angles(math.rad(0),math.rad(0), math.rad(0)), 0.1) | |
783 | torso.Weld.C0 = CFrame.new(0, -1, 0) * CFrame.Angles(math.rad(math.random(-90,90)),math.rad(0), math.rad(math.random(-180,180))) | |
784 | lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5,-0.925,0) * CFrame.Angles(math.rad(0),math.rad(0), math.rad(0)), 0.1) | |
785 | rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5,0,-0.8) * CFrame.Angles(math.rad(0),math.rad(0), math.rad(0)), 0.1) | |
786 | elseif (torso.Velocity*Vector3.new(1, 0, 1)).magnitude < 5 then | |
787 | hed.Weld.C0 = Lerp(hed.Weld.C0, CFrame.new(0, 1.5, -.1), 0.4) | |
788 | hed.Weld.C1 = Lerp(hed.Weld.C1, CFrame.Angles(math.rad(0+50*math.sin(sine/4)),0,0), 0.1) | |
789 | larm.Weld.C0 = Lerp(larm.Weld.C0, CFrame.new(-1.5,0.55,-0.05-0.2*math.cos(sine/4))*CFrame.Angles(math.rad(0+80*math.sin(sine/4)),math.rad(-5-5*math.sin(sine/8)),math.rad(-6+2*math.cos(sine/8))), 0.2) | |
790 | rarm.Weld.C0 = Lerp(rarm.Weld.C0, CFrame.new(1.5,0.55,-0.05-0.2*math.cos(sine/4))*CFrame.Angles(math.rad(0+80*math.sin(sine/4)),math.rad(5+5*math.sin(sine/8)),math.rad(6-2*math.cos(sine/8))), 0.2) | |
791 | torso.Weld.C0 = Lerp(torso.Weld.C0, CFrame.new(0, -1.1-hum.HipHeight, 0+2*math.cos(sine/4)) * CFrame.Angles(math.rad(0-80*math.cos(sine/4)),math.rad(0), math.rad(0-1*math.cos(sine/32))), 0.1) | |
792 | lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(0,llegendPoint.Y-lleg.Position.Y,0)*CFrame.new(-0.5,0,0)*CFrame.Angles(math.rad(0+120*math.cos(sine/4)),math.rad(10),math.rad(-5+1*math.cos(sine/16))), 0.1) | |
793 | rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0,rlegendPoint.Y-rleg.Position.Y,0)*CFrame.new(0.5,0,0)*CFrame.Angles(math.rad(0+120*math.cos(sine/4)),math.rad(-10),math.rad(5+1*math.cos(sine/16))), 0.1) | |
794 | end | |
795 | ||
796 | else | |
797 | hed.Weld.C0 = Lerp(hed.Weld.C0, CFrame.new(0, 1.5, -.1), 0.4) | |
798 | hed.Weld.C1 = Lerp(hed.Weld.C1, CFrame.Angles(0.05*math.sin(sine/16)+0.15,0.05*math.cos(sine/32),0.01*math.cos(sine/32)), 0.1) | |
799 | larm.Weld.C0 = Lerp(larm.Weld.C0, CFrame.new(-1.5,0.55-(0.1)*math.cos(sine/16)/3,-0.05-0.1*math.cos(sine/16))*CFrame.Angles(math.rad(-2+4*math.sin(sine/16)),math.rad(-5-5*math.sin(sine/16)),math.rad(-6+2*math.cos(sine/16))), 0.2) | |
800 | rarm.Weld.C0 = Lerp(rarm.Weld.C0, CFrame.new(1.5,0.55-(0.1)*math.cos(sine/16)/3,-0.05-0.1*math.cos(sine/16))*CFrame.Angles(math.rad(-2+4*math.sin(sine/16)),math.rad(5+5*math.sin(sine/16)),math.rad(6-2*math.cos(sine/16))), 0.2) | |
801 | torso.Weld.C0 = Lerp(torso.Weld.C0, CFrame.new(0, -1.4-(0.1)*math.cos(sine/16)-hum.HipHeight, 0) * CFrame.Angles(math.rad(0-2*math.cos(sine/16)),math.rad(0), math.rad(0-1*math.cos(sine/32))), 0.1) | |
802 | lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5,-0.55+(0.1)*math.cos(sine/16),0)*CFrame.Angles(math.rad(80+2*math.cos(sine/16)),math.rad(4),math.rad(-2+1*math.cos(sine/32))), 0.2) | |
803 | rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5,-0.55+(0.1)*math.cos(sine/16),0)*CFrame.Angles(math.rad(80+2*math.cos(sine/16)),math.rad(-4),math.rad(2+1*math.cos(sine/32))), 0.2) | |
804 | end | |
805 | ||
806 | end | |
807 | if didjump == true and jumped == false and jumppower < 0 then | |
808 | didjump = false | |
809 | jumpimpact() | |
810 | end | |
811 | ||
812 | sine = sine + change | |
813 | hum.Health = math.huge | |
814 | hum.MaxHealth = math.huge | |
815 | end) |