Advertisement
AndyWolf6610

Test

Oct 27th, 2019
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.59 KB | None | 0 0
  1. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  2. local Player,game,owner = owner,game
  3. local RealPlayer = Player
  4. do
  5. print("FE Compatibility code by Mokiros")
  6. local rp = RealPlayer
  7. script.Parent = rp.Character
  8.  
  9. --RemoteEvent for communicating
  10. local Event = Instance.new("RemoteEvent")
  11. Event.Name = "UserInput_Event"
  12.  
  13. --Fake event to make stuff like Mouse.KeyDown work
  14. local function fakeEvent()
  15. local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
  16. t.connect = t.Connect
  17. return t
  18. end
  19.  
  20. --Creating fake input objects with fake variables
  21. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  22. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  23. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  24. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  25. end}
  26. --Merged 2 functions into one by checking amount of arguments
  27. CAS.UnbindAction = CAS.BindAction
  28.  
  29. --This function will trigger the events that have been :Connect()'ed
  30. local function te(self,ev,...)
  31. local t = m[ev]
  32. if t and t._fakeEvent then
  33. for _,f in pairs(t.Functions) do
  34. f(...)
  35. end
  36. end
  37. end
  38. m.TrigEvent = te
  39. UIS.TrigEvent = te
  40.  
  41. Event.OnServerEvent:Connect(function(plr,io)
  42. if plr~=rp then return end
  43. m.Target = io.Target
  44. m.Hit = io.Hit
  45. if not io.isMouse then
  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 Mouse = Player:GetMouse()
  66. local UIS = game:GetService("UserInputService")
  67. local input = function(io,a)
  68. if a then return end
  69. --Since InputObject is a client-side instance, we create and pass table instead
  70. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  71. end
  72. UIS.InputBegan:Connect(input)
  73. UIS.InputEnded:Connect(input)
  74.  
  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.  
  85. ----Sandboxed game object that allows the usage of client-side methods and services
  86. --Real game object
  87. local _rg = game
  88.  
  89. --Metatable for fake service
  90. local fsmt = {
  91. __index = function(self,k)
  92. local s = rawget(self,"_RealService")
  93. if s then return s[k] end
  94. end,
  95. __newindex = function(self,k,v)
  96. local s = rawget(self,"_RealService")
  97. if s then s[k]=v end
  98. end,
  99. __call = function(self,...)
  100. local s = rawget(self,"_RealService")
  101. if s then return s(...) end
  102. end
  103. }
  104. local function FakeService(t,RealService)
  105. t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
  106. return setmetatable(t,fsmt)
  107. end
  108.  
  109. --Fake game object
  110. local g = {
  111. GetService = function(self,s)
  112. return self[s]
  113. end,
  114. Players = FakeService({
  115. LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
  116. },"Players"),
  117. UserInputService = FakeService(UIS,"UserInputService"),
  118. ContextActionService = FakeService(CAS,"ContextActionService"),
  119. }
  120. rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
  121. g.service = g.GetService
  122.  
  123. g.RunService = FakeService({
  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. setmetatable(g,{
  134. __index=function(self,s)
  135. return _rg:GetService(s) or typeof(_rg[s])=="function"
  136. and function(_,...)return _rg[s](_rg,...)end or _rg[s]
  137. end,
  138. __newindex = fsmt.__newindex,
  139. __call = fsmt.__call
  140. })
  141. --Changing owner to fake player object to support owner:GetMouse()
  142. game,owner = g,g.Players.LocalPlayer
  143. end
  144. -------------------
  145. print("animated by p00tp0t, converted and fixed by 123jl123")
  146. warn("refit function (anti-death) and music added by adam222334II")
  147. ArtificialHB = Instance.new("BindableEvent", script)
  148. ArtificialHB.Name = "Heartbeat"
  149. script:WaitForChild("Heartbeat")
  150.  
  151. Player = game:GetService("Players").LocalPlayer
  152. PlayerGui = Player.PlayerGui
  153. Cam = workspace.CurrentCamera
  154. Backpack = Player.Backpack
  155. Character = Player.Character
  156. Humanoid = Character.Humanoid
  157. Mouse = Player:GetMouse()
  158. RootPart = Character["HumanoidRootPart"]
  159. Torso = Character["Torso"]
  160. Head = Character["Head"]
  161. RightArm = Character["Right Arm"]
  162. LeftArm = Character["Left Arm"]
  163. RightLeg = Character["Right Leg"]
  164. LeftLeg = Character["Left Leg"]
  165. RootJoint = RootPart["RootJoint"]
  166. Neck = Torso["Neck"]
  167. RightShoulder = Torso["Right Shoulder"]
  168. LeftShoulder = Torso["Left Shoulder"]
  169. RightHip = Torso["Right Hip"]
  170. LeftHip = Torso["Left Hip"]
  171.  
  172. Character = Player.Character
  173. Humanoid = Character.Humanoid
  174.  
  175. local BODY = {}
  176. for _, c in pairs(Character:GetDescendants()) do
  177. if c:IsA("BasePart") and c.Name ~= "Handle" then
  178. if c ~= RootPart and c ~= Torso and c ~= Head and c ~= RightArm and c ~= LeftArm and c ~= RightLeg and c ~= LeftLeg then
  179. c.CustomPhysicalProperties = PhysicalProperties.new(0, 0, 0, 0, 0)
  180. end
  181. table.insert(BODY,{c,c.Parent,c.Material,c.Color,c.Transparency,c.Size,c.Name})
  182. elseif c:IsA("JointInstance") then
  183. table.insert(BODY,{c,c.Parent,nil,nil,nil,nil,nil})
  184. end
  185. end
  186.  
  187. function CreatePart(FORMFACTOR, PARENT, MATERIAL, REFLECTANCE, TRANSPARENCY, BRICKCOLOR, NAME, SIZE, ANCHOR)
  188. local NEWPART = IT("Part")
  189. NEWPART.formFactor = FORMFACTOR
  190. NEWPART.Reflectance = REFLECTANCE
  191. NEWPART.Transparency = TRANSPARENCY
  192. NEWPART.CanCollide = false
  193. NEWPART.Locked = true
  194. NEWPART.Anchored = true
  195. if ANCHOR == false then
  196. NEWPART.Anchored = false
  197. end
  198. NEWPART.BrickColor = BRICKC(tostring(BRICKCOLOR))
  199. NEWPART.Name = NAME
  200. NEWPART.Size = SIZE
  201. NEWPART.Position = Torso.Position
  202. NEWPART.Material = MATERIAL
  203. NEWPART:BreakJoints()
  204. NEWPART.Parent = PARENT
  205. return NEWPART
  206. end
  207.  
  208. CV="Maroon"
  209. Player = game.Players.LocalPlayer
  210. Character = Player.Character
  211. local txt = Instance.new("BillboardGui", Character)
  212. txt.Adornee = Character .Head
  213. txt.Name = "_status"
  214. txt.Size = UDim2.new(2, 0, 1.2, 0)
  215. txt.StudsOffset = Vector3.new(-9, 8, 0)
  216. local text = Instance.new("TextLabel", txt)
  217. text.Size = UDim2.new(10, 0, 7, 0)
  218. text.FontSize = "Size24"
  219. text.TextScaled = true
  220. text.TextTransparency = 0
  221. text.BackgroundTransparency = 1
  222. text.TextTransparency = 0
  223. text.TextStrokeTransparency = 0
  224. text.Font = "Bodoni"
  225. text.TextStrokeColor3 = Color3.new(255,0,0)
  226.  
  227. v=Instance.new("Part")
  228. v.Name = "ColorBrick"
  229. v.Parent=Player.Character
  230. v.FormFactor="Symmetric"
  231. v.Anchored=true
  232. v.CanCollide=false
  233. v.BottomSurface="Smooth"
  234. v.TopSurface="Smooth"
  235. v.Size=Vector3.new(3,3,3)
  236. v.Transparency=1
  237. v.CFrame=Character.Torso.CFrame
  238. v.BrickColor=BrickColor.new(CV)
  239. v.Transparency=1
  240. text.TextColor3 = Color3.new(0,0,0)
  241. v.Shape="Block"
  242. text.Text = "Baldi Justice"
  243.  
  244. function CreateWeldOrSnapOrMotor(TYPE, PARENT, PART0, PART1, C0, C1)
  245. local NEWWELD = IT(TYPE)
  246. NEWWELD.Part0 = PART0
  247. NEWWELD.Part1 = PART1
  248. NEWWELD.C0 = C0
  249. NEWWELD.C1 = C1
  250. NEWWELD.Parent = PARENT
  251. return NEWWELD
  252. end
  253.  
  254. for i,v in pairs(Character:children()) do
  255. if v:IsA("Shirt") and v:IsA("Pants") and v:IsA("Hat") and v:IsA("Accessory") then
  256. v:Remove()
  257. end
  258. end
  259. shirt = Instance.new("Shirt", Character)
  260. shirt.Name = "Shirt"
  261. pants = Instance.new("Pants", Character)
  262. pants.Name = "Pants"
  263. Character.Shirt.ShirtTemplate = "rbxassetid://1863468318"
  264. Character.Pants.PantsTemplate = "rbxassetid://1864334372"
  265.  
  266. Character.Head.face.Texture = "rbxassetid://168935168"
  267.  
  268. function refit()
  269. Character.Parent = workspace
  270. for e = 1, #BODY do
  271. if BODY[e] ~= nil then
  272. local STUFF = BODY[e]
  273. local PART = STUFF[1]
  274. local PARENT = STUFF[2]
  275. local MATERIAL = STUFF[3]
  276. local COLOR = STUFF[4]
  277. local TRANSPARENCY = STUFF[5]
  278. --local SIZE = STUFF[6]
  279. local NAME = STUFF[7]
  280. if PART.ClassName == "Part" and PART ~= RootPart then
  281. PART.Material = MATERIAL
  282. PART.Transparency = TRANSPARENCY
  283. PART.Name = NAME
  284. end
  285. if PART.Parent ~= PARENT then
  286. Humanoid:remove()
  287. PART.Parent = PARENT
  288. Humanoid = IT("Humanoid",Character)
  289. end
  290. end
  291. end
  292. end
  293.  
  294. Humanoid.Died:connect(function()
  295. refit()
  296. end)
  297.  
  298. Player = owner
  299. PlayerGui = Player.PlayerGui
  300. Cam = workspace.CurrentCamera
  301. Backpack = Player.Backpack
  302. Character = Player.Character
  303. Humanoid = Character.Humanoid
  304. Mouse = Player:GetMouse()
  305. RootPart = Character["HumanoidRootPart"]
  306. Torso = Character["Torso"]
  307. Head = Character["Head"]
  308. RightArm = Character["Right Arm"]
  309. LeftArm = Character["Left Arm"]
  310. RightLeg = Character["Right Leg"]
  311. LeftLeg = Character["Left Leg"]
  312. RootJoint = RootPart["RootJoint"]
  313. Neck = Torso["Neck"]
  314. RightShoulder = Torso["Right Shoulder"]
  315. LeftShoulder = Torso["Left Shoulder"]
  316. RightHip = Torso["Right Hip"]
  317. LeftHip = Torso["Left Hip"]
  318. local sick = Instance.new("Sound",Torso)
  319.  
  320. IT = Instance.new
  321. CF = CFrame.new
  322. VT = Vector3.new
  323. RAD = math.rad
  324. C3 = Color3.new
  325. UD2 = UDim2.new
  326. BRICKC = BrickColor.new
  327. ANGLES = CFrame.Angles
  328. EULER = CFrame.fromEulerAnglesXYZ
  329. COS = math.cos
  330. ACOS = math.acos
  331. SIN = math.sin
  332. ASIN = math.asin
  333. ABS = math.abs
  334. MRANDOM = math.random
  335. FLOOR = math.floor
  336.  
  337. local Speed = 0.1
  338. AnimationSpeed=.8
  339. SmoothTime=2
  340.  
  341. function swait(num)
  342. if num==0 or num==nil then
  343. --if Stagger.Value==false or Stun.Value<=100 then
  344. --Player.PlayerGui.Pacemaker.Heartbeat.Event:wait()
  345. script.Heartbeat.Event:wait()
  346. --end
  347. else
  348. for i=0,num do
  349. --Player.PlayerGui.Pacemaker.Heartbeat.Event:wait()
  350. script.Heartbeat.Event:wait()
  351. --[[if Stagger.Value==true or Stun.Value>=StunT.Value then
  352. break
  353. end]]
  354. end
  355. end
  356. end
  357. script:WaitForChild("Heartbeat")
  358.  
  359. frame = 1/60
  360. tf = 0
  361. allowframeloss = false --if set to true will fire every frame it possibly can. This will result in multiple events happening at the same time whenever delta returns frame2 or greater.
  362. tossremainder = false --if set to true t will be set to 0 after Fire()-ing.
  363. lastframe = tick()
  364. script.Heartbeat:Fire() --ayy lmao
  365.  
  366. game:GetService("RunService").Heartbeat:connect(function(s,p) --herp derp
  367. tf = tf + s
  368. if tf >= frame then
  369. if allowframeloss then
  370. script.Heartbeat:Fire()
  371. lastframe=tick()
  372. else
  373. ----print("FIRED "..math.floor(t/frame).." FRAME(S)","REMAINDER "..(t - frame(math.floor(t/frame))))
  374. for i=1, math.floor(tf/frame) do
  375. script.Heartbeat:Fire()
  376. end
  377. lastframe=tick()
  378. end
  379. if tossremainder then
  380. tf = 0
  381. else
  382. tf = tf - frame * math.floor(tf/frame)
  383. end
  384. end
  385. end)
  386.  
  387. Anim = {
  388. Properties = {
  389. Looping = true,
  390. Priority = Enum.AnimationPriority.Core
  391. },
  392. Keyframes = {
  393. [0] = {
  394. ["HumanoidRootPart"] = {
  395. ["Torso"] = {
  396. CFrame = CFrame.new(0, 0, -1.228) * CFrame.Angles(math.rad(57.009), 0, 0),
  397. ["Left Leg"] = {
  398. CFrame = CFrame.new(-0.347, 0.705, 0.089) * CFrame.Angles(math.rad(3.953), math.rad(12.147), math.rad(-18.163)),
  399. },
  400. ["Right Leg"] = {
  401. CFrame = CFrame.new(0.283, 0.755, 0.045) * CFrame.Angles(math.rad(7.105), math.rad(-18.965), math.rad(20.913)),
  402. },
  403. ["Left Arm"] = {
  404. CFrame = CFrame.new(-0.854, -0.148, -0.819) * CFrame.Angles(math.rad(-2.292), math.rad(-0.401), math.rad(-79.813)),
  405. },
  406. ["Right Arm"] = {
  407. CFrame = CFrame.new(0.806, -0.16, -0.729) * CFrame.Angles(math.rad(-0.229), math.rad(0.057), math.rad(75.974)),
  408. },
  409. ["Head"] = {
  410. CFrame = CFrame.new(0, 0.009, -0.063) * CFrame.Angles(math.rad(-43.717), 0, 0),
  411. },
  412. },
  413. },
  414. },
  415. [1.15] = {
  416. ["HumanoidRootPart"] = {
  417. ["Torso"] = {
  418. CFrame = CFrame.new(0, 0.009, -1.361) * CFrame.Angles(math.rad(52.54), 0, 0),
  419. ["Left Leg"] = {
  420. CFrame = CFrame.new(-0.22, 0.958, 0.089) * CFrame.Angles(math.rad(5.042), math.rad(18.105), math.rad(-15.928)),
  421. },
  422. ["Right Leg"] = {
  423. CFrame = CFrame.new(0.293, 0.931, 0.045) * CFrame.Angles(math.rad(4.813), math.rad(-18.048), math.rad(15.183)),
  424. },
  425. ["Left Arm"] = {
  426. CFrame = CFrame.new(-0.808, -0.119, -0.819) * CFrame.Angles(0, 0, math.rad(-74.599)),
  427. },
  428. ["Right Arm"] = {
  429. CFrame = CFrame.new(0.709, -0.121, -0.729) * CFrame.Angles(0, 0, math.rad(73.74)),
  430. },
  431. ["Head"] = {
  432. CFrame = CFrame.new(0, 0.009, -0.063) * CFrame.Angles(math.rad(-39.649), 0, 0),
  433. },
  434. },
  435. },
  436. },
  437. [2] = {
  438. ["HumanoidRootPart"] = {
  439. ["Torso"] = {
  440. CFrame = CFrame.new(0, 0, -1.228) * CFrame.Angles(math.rad(57.009), 0, 0),
  441. ["Left Leg"] = {
  442. CFrame = CFrame.new(-0.347, 0.705, 0.089) * CFrame.Angles(math.rad(3.953), math.rad(12.147), math.rad(-18.163)),
  443. },
  444. ["Right Leg"] = {
  445. CFrame = CFrame.new(0.283, 0.755, 0.045) * CFrame.Angles(math.rad(7.105), math.rad(-18.965), math.rad(20.913)),
  446. },
  447. ["Left Arm"] = {
  448. CFrame = CFrame.new(-0.854, -0.148, -0.819) * CFrame.Angles(math.rad(-2.292), math.rad(-0.401), math.rad(-79.813)),
  449. },
  450. ["Right Arm"] = {
  451. CFrame = CFrame.new(0.806, -0.16, -0.729) * CFrame.Angles(math.rad(-0.229), math.rad(0.057), math.rad(75.974)),
  452. },
  453. ["Head"] = {
  454. CFrame = CFrame.new(0, 0.009, -0.063) * CFrame.Angles(math.rad(-43.717), 0, 0),
  455. },
  456. },
  457. },
  458. },
  459. }
  460. }
  461.  
  462.  
  463. local number=0
  464.  
  465. LastTimeSetTotal=0
  466. local savec0 = {}
  467.  
  468.  
  469. GetAnimCF = function(limb,Time)
  470.  
  471. local GA = nil
  472. coroutine.resume(coroutine.create(function()
  473.  
  474. if limb == "Torso" then
  475. GA = Anim.Keyframes[Time]["HumanoidRootPart"]["Torso"].CFrame
  476. else
  477. GA = Anim.Keyframes[Time]["HumanoidRootPart"]["Torso"][""..limb].CFrame
  478.  
  479. end
  480. end))
  481. return GA
  482. end
  483.  
  484.  
  485.  
  486. local model = nil
  487. if owner ~= nil then
  488. model = owner.Character
  489. else
  490. model = game:GetService("Players").localPlayer.Character
  491. end
  492. function GatherAllInstances(Parent)
  493. local Instances = {}
  494. local function GatherInstances(Parent)
  495. for i, v in pairs(Parent:GetChildren()) do
  496. GatherInstances(v)
  497. table.insert(Instances, v)
  498. end
  499. end
  500. GatherInstances(Parent)
  501. return Instances
  502. end
  503.  
  504.  
  505.  
  506.  
  507. for i, v in pairs(GatherAllInstances(model)) do
  508. if v:IsA("BasePart") then
  509. for i, v2 in pairs(GatherAllInstances(model)) do
  510. if v2:IsA("Motor6D") and v2.Part1.Name == v.Name then
  511.  
  512. local saveCF = v2.C0
  513. table.insert(savec0,{v2.Name,saveCF})
  514.  
  515. end
  516. end
  517. end end
  518.  
  519.  
  520.  
  521.  
  522. RunAnim = function(Time)
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529. local speed = Time-LastTimeSetTotal
  530.  
  531. speed = speed*AnimationSpeed
  532. LastTimeSetTotal = Time
  533.  
  534.  
  535.  
  536. local doing = true
  537.  
  538. coroutine.resume(coroutine.create(function()
  539. for i, v in pairs(GatherAllInstances(model)) do
  540. if v:IsA("BasePart") then
  541. for i, v2 in pairs(GatherAllInstances(model)) do
  542. if v2:IsA("Motor6D") and v2.Part1.Name == v.Name then
  543.  
  544. --print(v.Name)
  545. local GotAnim = GetAnimCF(v.Name,Time)
  546. --print(GotAnim)
  547. local saveCF = nil
  548. for i,v3 in pairs(savec0) do
  549. if v2.name == v3[1] then
  550. saveCF = v3[2]
  551. end
  552. end
  553.  
  554. --print(saveCF)
  555.  
  556. if GotAnim ~= nil and saveCF ~= nil then
  557.  
  558.  
  559. coroutine.resume(coroutine.create(function()
  560. while doing == true do
  561. swait()
  562. v2.C0 = v2.C0:lerp(saveCF*GotAnim,SmoothTime *speed)
  563. end
  564.  
  565. end))
  566. --v2.C0 = saveCF*GotAnim
  567.  
  568.  
  569. end
  570.  
  571. end
  572.  
  573. end
  574. end end
  575.  
  576.  
  577. end))
  578. wait(speed)
  579. doing = false
  580. end
  581. while true do
  582. RunAnim(0)
  583. ----------
  584. RunAnim(1.15)
  585. RunAnim(2)
  586. -----------
  587.  
  588. LastTimeSetTotal = .1
  589. Humanoid.MaxHealth = "inf"
  590. Humanoid.Health = "inf"
  591. sick.SoundId = "rbxassetid://2041736491"
  592. sick.Looped = true
  593. sick.Pitch = 1
  594. sick.Volume = 10
  595. sick:Resume()
  596. sick.Parent = Torso
  597. refit()
  598. end
  599. --print(Anim.Keyframes[number]["HumanoidRootPart"]["Torso"]["Left Leg"].CFrame)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement