Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
- local Player,game,owner = owner,game
- local RealPlayer = Player
- do
- print("FE Compatibility code by Mokiros")
- local rp = RealPlayer
- script.Parent = rp.Character
- --RemoteEvent for communicating
- local Event = Instance.new("RemoteEvent")
- Event.Name = "UserInput_Event"
- --Fake event to make stuff like Mouse.KeyDown work
- local function fakeEvent()
- local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
- t.connect = t.Connect
- return t
- end
- --Creating fake input objects with fake variables
- local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
- local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
- local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
- CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
- end}
- --Merged 2 functions into one by checking amount of arguments
- CAS.UnbindAction = CAS.BindAction
- --This function will trigger the events that have been :Connect()'ed
- local function te(self,ev,...)
- local t = m[ev]
- if t and t._fakeEvent then
- for _,f in pairs(t.Functions) do
- f(...)
- end
- end
- end
- m.TrigEvent = te
- UIS.TrigEvent = te
- Event.OnServerEvent:Connect(function(plr,io)
- if plr~=rp then return end
- m.Target = io.Target
- m.Hit = io.Hit
- if not io.isMouse then
- local b = io.UserInputState == Enum.UserInputState.Begin
- if io.UserInputType == Enum.UserInputType.MouseButton1 then
- return m:TrigEvent(b and "Button1Down" or "Button1Up")
- end
- for _,t in pairs(CAS.Actions) do
- for _,k in pairs(t.Keys) do
- if k==io.KeyCode then
- t.Function(t.Name,io.UserInputState,io)
- end
- end
- end
- m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
- UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
- end
- end)
- Event.Parent = NLS([==[
- local Player = game:GetService("Players").LocalPlayer
- local Event = script:WaitForChild("UserInput_Event")
- local Mouse = Player:GetMouse()
- local UIS = game:GetService("UserInputService")
- local input = function(io,a)
- if a then return end
- --Since InputObject is a client-side instance, we create and pass table instead
- Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
- end
- UIS.InputBegan:Connect(input)
- UIS.InputEnded:Connect(input)
- local h,t
- --Give the server mouse data 30 times every second, but only if the values changed
- --If player is not moving their mouse, client won't fire events
- while wait(1/30) do
- if h~=Mouse.Hit or t~=Mouse.Target then
- h,t=Mouse.Hit,Mouse.Target
- Event:FireServer({isMouse=true,Target=t,Hit=h})
- end
- end]==],Player.Character)
- ----Sandboxed game object that allows the usage of client-side methods and services
- --Real game object
- local _rg = game
- --Metatable for fake service
- local fsmt = {
- __index = function(self,k)
- local s = rawget(self,"_RealService")
- if s then return s[k] end
- end,
- __newindex = function(self,k,v)
- local s = rawget(self,"_RealService")
- if s then s[k]=v end
- end,
- __call = function(self,...)
- local s = rawget(self,"_RealService")
- if s then return s(...) end
- end
- }
- local function FakeService(t,RealService)
- t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
- return setmetatable(t,fsmt)
- end
- --Fake game object
- local g = {
- GetService = function(self,s)
- return self[s]
- end,
- Players = FakeService({
- LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
- },"Players"),
- UserInputService = FakeService(UIS,"UserInputService"),
- ContextActionService = FakeService(CAS,"ContextActionService"),
- }
- rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
- g.service = g.GetService
- g.RunService = FakeService({
- RenderStepped = _rg:GetService("RunService").Heartbeat,
- BindToRenderStep = function(self,name,_,fun)
- self._btrs[name] = self.Heartbeat:Connect(fun)
- end,
- UnbindFromRenderStep = function(self,name)
- self._btrs[name]:Disconnect()
- end,
- },"RunService")
- setmetatable(g,{
- __index=function(self,s)
- return _rg:GetService(s) or typeof(_rg[s])=="function"
- and function(_,...)return _rg[s](_rg,...)end or _rg[s]
- end,
- __newindex = fsmt.__newindex,
- __call = fsmt.__call
- })
- --Changing owner to fake player object to support owner:GetMouse()
- game,owner = g,g.Players.LocalPlayer
- end
- -------------------
- print("animated by p00tp0t, converted and fixed by 123jl123")
- warn("refit function (anti-death) and music added by adam222334II")
- ArtificialHB = Instance.new("BindableEvent", script)
- ArtificialHB.Name = "Heartbeat"
- script:WaitForChild("Heartbeat")
- Player = game:GetService("Players").LocalPlayer
- PlayerGui = Player.PlayerGui
- Cam = workspace.CurrentCamera
- Backpack = Player.Backpack
- Character = Player.Character
- Humanoid = Character.Humanoid
- Mouse = Player:GetMouse()
- RootPart = Character["HumanoidRootPart"]
- Torso = Character["Torso"]
- Head = Character["Head"]
- RightArm = Character["Right Arm"]
- LeftArm = Character["Left Arm"]
- RightLeg = Character["Right Leg"]
- LeftLeg = Character["Left Leg"]
- RootJoint = RootPart["RootJoint"]
- Neck = Torso["Neck"]
- RightShoulder = Torso["Right Shoulder"]
- LeftShoulder = Torso["Left Shoulder"]
- RightHip = Torso["Right Hip"]
- LeftHip = Torso["Left Hip"]
- Character = Player.Character
- Humanoid = Character.Humanoid
- local BODY = {}
- for _, c in pairs(Character:GetDescendants()) do
- if c:IsA("BasePart") and c.Name ~= "Handle" then
- if c ~= RootPart and c ~= Torso and c ~= Head and c ~= RightArm and c ~= LeftArm and c ~= RightLeg and c ~= LeftLeg then
- c.CustomPhysicalProperties = PhysicalProperties.new(0, 0, 0, 0, 0)
- end
- table.insert(BODY,{c,c.Parent,c.Material,c.Color,c.Transparency,c.Size,c.Name})
- elseif c:IsA("JointInstance") then
- table.insert(BODY,{c,c.Parent,nil,nil,nil,nil,nil})
- end
- end
- function CreatePart(FORMFACTOR, PARENT, MATERIAL, REFLECTANCE, TRANSPARENCY, BRICKCOLOR, NAME, SIZE, ANCHOR)
- local NEWPART = IT("Part")
- NEWPART.formFactor = FORMFACTOR
- NEWPART.Reflectance = REFLECTANCE
- NEWPART.Transparency = TRANSPARENCY
- NEWPART.CanCollide = false
- NEWPART.Locked = true
- NEWPART.Anchored = true
- if ANCHOR == false then
- NEWPART.Anchored = false
- end
- NEWPART.BrickColor = BRICKC(tostring(BRICKCOLOR))
- NEWPART.Name = NAME
- NEWPART.Size = SIZE
- NEWPART.Position = Torso.Position
- NEWPART.Material = MATERIAL
- NEWPART:BreakJoints()
- NEWPART.Parent = PARENT
- return NEWPART
- end
- CV="Maroon"
- Player = game.Players.LocalPlayer
- Character = Player.Character
- local txt = Instance.new("BillboardGui", Character)
- txt.Adornee = Character .Head
- txt.Name = "_status"
- txt.Size = UDim2.new(2, 0, 1.2, 0)
- txt.StudsOffset = Vector3.new(-9, 8, 0)
- local text = Instance.new("TextLabel", txt)
- text.Size = UDim2.new(10, 0, 7, 0)
- text.FontSize = "Size24"
- text.TextScaled = true
- text.TextTransparency = 0
- text.BackgroundTransparency = 1
- text.TextTransparency = 0
- text.TextStrokeTransparency = 0
- text.Font = "Bodoni"
- text.TextStrokeColor3 = Color3.new(255,0,0)
- v=Instance.new("Part")
- v.Name = "ColorBrick"
- v.Parent=Player.Character
- v.FormFactor="Symmetric"
- v.Anchored=true
- v.CanCollide=false
- v.BottomSurface="Smooth"
- v.TopSurface="Smooth"
- v.Size=Vector3.new(3,3,3)
- v.Transparency=1
- v.CFrame=Character.Torso.CFrame
- v.BrickColor=BrickColor.new(CV)
- v.Transparency=1
- text.TextColor3 = Color3.new(0,0,0)
- v.Shape="Block"
- text.Text = "Baldi Justice"
- function CreateWeldOrSnapOrMotor(TYPE, PARENT, PART0, PART1, C0, C1)
- local NEWWELD = IT(TYPE)
- NEWWELD.Part0 = PART0
- NEWWELD.Part1 = PART1
- NEWWELD.C0 = C0
- NEWWELD.C1 = C1
- NEWWELD.Parent = PARENT
- return NEWWELD
- end
- for i,v in pairs(Character:children()) do
- if v:IsA("Shirt") and v:IsA("Pants") and v:IsA("Hat") and v:IsA("Accessory") then
- v:Remove()
- end
- end
- shirt = Instance.new("Shirt", Character)
- shirt.Name = "Shirt"
- pants = Instance.new("Pants", Character)
- pants.Name = "Pants"
- Character.Shirt.ShirtTemplate = "rbxassetid://1863468318"
- Character.Pants.PantsTemplate = "rbxassetid://1864334372"
- Character.Head.face.Texture = "rbxassetid://168935168"
- function refit()
- Character.Parent = workspace
- for e = 1, #BODY do
- if BODY[e] ~= nil then
- local STUFF = BODY[e]
- local PART = STUFF[1]
- local PARENT = STUFF[2]
- local MATERIAL = STUFF[3]
- local COLOR = STUFF[4]
- local TRANSPARENCY = STUFF[5]
- --local SIZE = STUFF[6]
- local NAME = STUFF[7]
- if PART.ClassName == "Part" and PART ~= RootPart then
- PART.Material = MATERIAL
- PART.Transparency = TRANSPARENCY
- PART.Name = NAME
- end
- if PART.Parent ~= PARENT then
- Humanoid:remove()
- PART.Parent = PARENT
- Humanoid = IT("Humanoid",Character)
- end
- end
- end
- end
- Humanoid.Died:connect(function()
- refit()
- end)
- Player = owner
- PlayerGui = Player.PlayerGui
- Cam = workspace.CurrentCamera
- Backpack = Player.Backpack
- Character = Player.Character
- Humanoid = Character.Humanoid
- Mouse = Player:GetMouse()
- RootPart = Character["HumanoidRootPart"]
- Torso = Character["Torso"]
- Head = Character["Head"]
- RightArm = Character["Right Arm"]
- LeftArm = Character["Left Arm"]
- RightLeg = Character["Right Leg"]
- LeftLeg = Character["Left Leg"]
- RootJoint = RootPart["RootJoint"]
- Neck = Torso["Neck"]
- RightShoulder = Torso["Right Shoulder"]
- LeftShoulder = Torso["Left Shoulder"]
- RightHip = Torso["Right Hip"]
- LeftHip = Torso["Left Hip"]
- local sick = Instance.new("Sound",Torso)
- IT = Instance.new
- CF = CFrame.new
- VT = Vector3.new
- RAD = math.rad
- C3 = Color3.new
- UD2 = UDim2.new
- BRICKC = BrickColor.new
- ANGLES = CFrame.Angles
- EULER = CFrame.fromEulerAnglesXYZ
- COS = math.cos
- ACOS = math.acos
- SIN = math.sin
- ASIN = math.asin
- ABS = math.abs
- MRANDOM = math.random
- FLOOR = math.floor
- local Speed = 0.1
- AnimationSpeed=.8
- SmoothTime=2
- function swait(num)
- if num==0 or num==nil then
- --if Stagger.Value==false or Stun.Value<=100 then
- --Player.PlayerGui.Pacemaker.Heartbeat.Event:wait()
- script.Heartbeat.Event:wait()
- --end
- else
- for i=0,num do
- --Player.PlayerGui.Pacemaker.Heartbeat.Event:wait()
- script.Heartbeat.Event:wait()
- --[[if Stagger.Value==true or Stun.Value>=StunT.Value then
- break
- end]]
- end
- end
- end
- script:WaitForChild("Heartbeat")
- frame = 1/60
- tf = 0
- 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.
- tossremainder = false --if set to true t will be set to 0 after Fire()-ing.
- lastframe = tick()
- script.Heartbeat:Fire() --ayy lmao
- game:GetService("RunService").Heartbeat:connect(function(s,p) --herp derp
- tf = tf + s
- if tf >= frame then
- if allowframeloss then
- script.Heartbeat:Fire()
- lastframe=tick()
- else
- ----print("FIRED "..math.floor(t/frame).." FRAME(S)","REMAINDER "..(t - frame(math.floor(t/frame))))
- for i=1, math.floor(tf/frame) do
- script.Heartbeat:Fire()
- end
- lastframe=tick()
- end
- if tossremainder then
- tf = 0
- else
- tf = tf - frame * math.floor(tf/frame)
- end
- end
- end)
- Anim = {
- Properties = {
- Looping = true,
- Priority = Enum.AnimationPriority.Core
- },
- Keyframes = {
- [0] = {
- ["HumanoidRootPart"] = {
- ["Torso"] = {
- CFrame = CFrame.new(0, 0, -1.228) * CFrame.Angles(math.rad(57.009), 0, 0),
- ["Left Leg"] = {
- CFrame = CFrame.new(-0.347, 0.705, 0.089) * CFrame.Angles(math.rad(3.953), math.rad(12.147), math.rad(-18.163)),
- },
- ["Right Leg"] = {
- CFrame = CFrame.new(0.283, 0.755, 0.045) * CFrame.Angles(math.rad(7.105), math.rad(-18.965), math.rad(20.913)),
- },
- ["Left Arm"] = {
- CFrame = CFrame.new(-0.854, -0.148, -0.819) * CFrame.Angles(math.rad(-2.292), math.rad(-0.401), math.rad(-79.813)),
- },
- ["Right Arm"] = {
- CFrame = CFrame.new(0.806, -0.16, -0.729) * CFrame.Angles(math.rad(-0.229), math.rad(0.057), math.rad(75.974)),
- },
- ["Head"] = {
- CFrame = CFrame.new(0, 0.009, -0.063) * CFrame.Angles(math.rad(-43.717), 0, 0),
- },
- },
- },
- },
- [1.15] = {
- ["HumanoidRootPart"] = {
- ["Torso"] = {
- CFrame = CFrame.new(0, 0.009, -1.361) * CFrame.Angles(math.rad(52.54), 0, 0),
- ["Left Leg"] = {
- CFrame = CFrame.new(-0.22, 0.958, 0.089) * CFrame.Angles(math.rad(5.042), math.rad(18.105), math.rad(-15.928)),
- },
- ["Right Leg"] = {
- CFrame = CFrame.new(0.293, 0.931, 0.045) * CFrame.Angles(math.rad(4.813), math.rad(-18.048), math.rad(15.183)),
- },
- ["Left Arm"] = {
- CFrame = CFrame.new(-0.808, -0.119, -0.819) * CFrame.Angles(0, 0, math.rad(-74.599)),
- },
- ["Right Arm"] = {
- CFrame = CFrame.new(0.709, -0.121, -0.729) * CFrame.Angles(0, 0, math.rad(73.74)),
- },
- ["Head"] = {
- CFrame = CFrame.new(0, 0.009, -0.063) * CFrame.Angles(math.rad(-39.649), 0, 0),
- },
- },
- },
- },
- [2] = {
- ["HumanoidRootPart"] = {
- ["Torso"] = {
- CFrame = CFrame.new(0, 0, -1.228) * CFrame.Angles(math.rad(57.009), 0, 0),
- ["Left Leg"] = {
- CFrame = CFrame.new(-0.347, 0.705, 0.089) * CFrame.Angles(math.rad(3.953), math.rad(12.147), math.rad(-18.163)),
- },
- ["Right Leg"] = {
- CFrame = CFrame.new(0.283, 0.755, 0.045) * CFrame.Angles(math.rad(7.105), math.rad(-18.965), math.rad(20.913)),
- },
- ["Left Arm"] = {
- CFrame = CFrame.new(-0.854, -0.148, -0.819) * CFrame.Angles(math.rad(-2.292), math.rad(-0.401), math.rad(-79.813)),
- },
- ["Right Arm"] = {
- CFrame = CFrame.new(0.806, -0.16, -0.729) * CFrame.Angles(math.rad(-0.229), math.rad(0.057), math.rad(75.974)),
- },
- ["Head"] = {
- CFrame = CFrame.new(0, 0.009, -0.063) * CFrame.Angles(math.rad(-43.717), 0, 0),
- },
- },
- },
- },
- }
- }
- local number=0
- LastTimeSetTotal=0
- local savec0 = {}
- GetAnimCF = function(limb,Time)
- local GA = nil
- coroutine.resume(coroutine.create(function()
- if limb == "Torso" then
- GA = Anim.Keyframes[Time]["HumanoidRootPart"]["Torso"].CFrame
- else
- GA = Anim.Keyframes[Time]["HumanoidRootPart"]["Torso"][""..limb].CFrame
- end
- end))
- return GA
- end
- local model = nil
- if owner ~= nil then
- model = owner.Character
- else
- model = game:GetService("Players").localPlayer.Character
- end
- function GatherAllInstances(Parent)
- local Instances = {}
- local function GatherInstances(Parent)
- for i, v in pairs(Parent:GetChildren()) do
- GatherInstances(v)
- table.insert(Instances, v)
- end
- end
- GatherInstances(Parent)
- return Instances
- end
- for i, v in pairs(GatherAllInstances(model)) do
- if v:IsA("BasePart") then
- for i, v2 in pairs(GatherAllInstances(model)) do
- if v2:IsA("Motor6D") and v2.Part1.Name == v.Name then
- local saveCF = v2.C0
- table.insert(savec0,{v2.Name,saveCF})
- end
- end
- end end
- RunAnim = function(Time)
- local speed = Time-LastTimeSetTotal
- speed = speed*AnimationSpeed
- LastTimeSetTotal = Time
- local doing = true
- coroutine.resume(coroutine.create(function()
- for i, v in pairs(GatherAllInstances(model)) do
- if v:IsA("BasePart") then
- for i, v2 in pairs(GatherAllInstances(model)) do
- if v2:IsA("Motor6D") and v2.Part1.Name == v.Name then
- --print(v.Name)
- local GotAnim = GetAnimCF(v.Name,Time)
- --print(GotAnim)
- local saveCF = nil
- for i,v3 in pairs(savec0) do
- if v2.name == v3[1] then
- saveCF = v3[2]
- end
- end
- --print(saveCF)
- if GotAnim ~= nil and saveCF ~= nil then
- coroutine.resume(coroutine.create(function()
- while doing == true do
- swait()
- v2.C0 = v2.C0:lerp(saveCF*GotAnim,SmoothTime *speed)
- end
- end))
- --v2.C0 = saveCF*GotAnim
- end
- end
- end
- end end
- end))
- wait(speed)
- doing = false
- end
- while true do
- RunAnim(0)
- ----------
- RunAnim(1.15)
- RunAnim(2)
- -----------
- LastTimeSetTotal = .1
- Humanoid.MaxHealth = "inf"
- Humanoid.Health = "inf"
- sick.SoundId = "rbxassetid://2041736491"
- sick.Looped = true
- sick.Pitch = 1
- sick.Volume = 10
- sick:Resume()
- sick.Parent = Torso
- refit()
- end
- --print(Anim.Keyframes[number]["HumanoidRootPart"]["Torso"]["Left Leg"].CFrame)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement