Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local data=require(game.ReplicatedStorage.mainModule)
- local Run=data:GetService("Run")
- local Player=game.Players.LocalPlayer
- repeat wait() until Player.Character
- local Character=Player.Character
- local Root=Character:WaitForChild("HumanoidRootPart")
- local Storage=data.Storage
- local Interrupt=false
- Character:WaitForChild("Humanoid").CameraOffset=Vector3.new(0,5,-.4)
- local Body=Storage.AnimStorage.Body:Clone()
- Body.Parent=workspace
- Body.Name=Player.Name.."_Body"
- for i,v in pairs(Body:GetChildren()) do
- if v:IsA("BasePart") then
- local rot=v.Original.Rotation.Value
- v.CF.Value=CFrame.new(v.Original.Offset.Value)*CFrame.Angles(math.rad(rot.X),math.rad(rot.Y),math.rad(rot.Z))
- v.Original.CF.Value=v.CF.Value
- end
- end
- local UpdateOrder={"Root","UpperTorso","LowerTorso","Neck","LeftShoulder","RightShoulder","LeftBicep","RightBicep","LeftElbow","RightElbow","LeftForearm","RightForearm","Hips","LeftUpperThigh","LeftLowerThigh","RightUpperThigh","RightLowerThigh","LeftKnee","RightKnee","LeftShin","RightShin"}
- function Update()
- for i,v in pairs(UpdateOrder) do
- local Part=Body:FindFirstChild(v)
- if Part then
- if Part.Name=="Root" then
- Part.CFrame=Root.CFrame*Part.CF.Value
- --Part.CFrame=Root.CFrame*CFrame.new(Part.Offset.Value)*CFrame.Angles(math.rad(Part.Rot.Value.X),math.rad(Part.Rot.Value.Y),math.rad(Part.Rot.Value.Z))
- else
- local Connection=Body:FindFirstChild(Part.Connection.Value)
- if not Connection then
- Part:destroy()
- else
- Part.CFrame=Connection.CFrame*Part.CF.Value
- --Part.CFrame=Connection.CFrame*CFrame.new(Part.Offset.Value)*CFrame.Angles(math.rad(Part.Rot.Value.X),math.rad(Part.Rot.Value.Y),math.rad(Part.Rot.Value.Z))
- end
- end
- else
- print(v.." not found!")
- end
- end
- end
- function UpdateEquipment()
- pcall(function()
- for i,v in pairs(Body.Equipment:GetChildren()) do
- local Con=Body:FindFirstChild(v.Name)
- if Con then
- v.Main.CFrame=Con.CFrame*v.Main.CF.Value
- for k,l in pairs(v:GetChildren()) do
- if l.Name~="Main" then
- if not l:FindFirstChild("Weld") then
- l.Anchored=true
- v.Main.Anchored=true
- local w=Instance.new("Weld",l)
- w.Part0=v.Main
- w.Part1=l
- w.C0=w.Part0.CFrame:inverse()
- w.C1=w.Part1.CFrame:inverse()
- l.Anchored=false
- v.Main.Anchored=false
- end
- end
- end
- end
- end
- end)
- end
- Player.CharacterAppearance=""
- function Recursion(A)
- for i,v in pairs(A:GetChildren()) do
- if v:IsA("Decal") or v:IsA("CharacterAppearance") or v:IsA("Hat") or v:IsA("CharacterMesh") or v:IsA("BaseScript") then
- v:destroy()
- end
- if v:IsA("BasePart") then
- v.Transparency=1
- end
- Recursion(v)
- end
- end
- data.Thread(function()
- wait(1)
- while true do
- wait()
- Recursion(Character)
- end
- end)
- data.Thread(function()
- while true do
- Run.RenderStepped:wait()
- Update()
- --UpdateEquipment()
- end
- end)
- function LerpAngle(Joint,NewOffset,NewRot,Steps)
- local NewCF=CFrame.new(NewOffset[1],NewOffset[2],NewOffset[3])*CFrame.Angles(math.rad(NewRot[1]),math.rad(NewRot[2]),math.rad(NewRot[3]))
- if not Steps then Steps=.03 end
- if Steps>1 then Steps=1 end
- if Steps<=0 then Steps=.0025 end
- Joint=Body:FindFirstChild(Joint)
- NewCF=Joint.Original.CF.Value*NewCF
- local OldAngle=Vector3.new(Joint.CF.Value:toEulerAnglesXYZ())
- local OldPosition=Joint.CF.Value.p
- local NewAngle=Vector3.new(NewCF:toEulerAnglesXYZ())
- local NewPosition=NewCF.p
- --coroutine.wrap(function()
- for i=0,1,Steps do
- Joint.CF.Value=CFrame.new((OldPosition*(1-i))+(NewPosition*i))*CFrame.fromEulerAnglesXYZ((OldAngle.x*(1-i))+(NewAngle.x*i),(OldAngle.y*(1-i))+(NewAngle.y*i),(OldAngle.z*(1-i))+(NewAngle.z*i))
- wait()
- end
- --end)()
- end
- local LoadedAnimations={}
- function LoadAnim(Name)
- if LoadedAnimations[Name] then print(Name.." has already been loaded; returning") return LoadedAnimations[Name] end
- local Anim=game.ReplicatedStorage.AnimStorage.Animations[Name]
- local Table={}
- for _,Keyframe in pairs(Anim:GetChildren()) do
- Table[#Table+1]=require(Keyframe)
- --Table[#Table+1]=game:GetService("HttpService"):JSONDecode(Keyframe.Value)
- end
- Table.Play=function(Self)
- for i,v in pairs(Table) do
- --for i,v in pairs(r) do
- if type(v)=="table" then
- local maxStep=0
- for k,l in pairs(v) do
- coroutine.wrap(function() --[[if l[1]=="LeftShoulder" or l[1]=="RightShoulder" then return end--]] LerpAngle(l[1],l[2],l[3],l[4]) end)()
- if l[4]>maxStep then
- maxStep=l[4]
- end
- end
- local a=0
- repeat wait() a=a+maxStep until a>=1
- end
- --end
- end
- end
- LoadedAnimations[Name]=Table
- return Table
- end
- --
- local t=LoadAnim("Breathe")
- coroutine.wrap(function()
- while wait() do
- t:Play()
- end
- end)()
- --]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement