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