Emp Reanim v6 1
Emp Reanim v6 1
do
local Accessories = {}
local Aligns = {}
local Attachments = {}
local Blacklist = {}
local Exceptions = {}
local Highlights = {}
local RBXScriptConnections = {}
local Targets = {}
R15Animation.AnimationId = "rbxassetid://507767968"
R6Animation.AnimationId = "rbxassetid://180436148"
Humanoid = nil
Destroy(HumanoidDescription)
HumanoidDescription = nil
if Handle then
local MeshId = nil
local TextureId = nil
if SpecialMesh then
MeshId = SpecialMesh.MeshId
TextureId = SpecialMesh.TextureId
end
end
if MeshId then
if stringfind(MeshId, Table.MeshId) and
stringfind(TextureId, Table.TextureId) then
return Handle
end
end
end
end
end
end
local NewIndex = function(self, Index, Value)
self[Index] = Value
end
if Attachment then
local Parent = Descendant.Parent
if SpecialMesh then
MeshId = SpecialMesh.MeshId
TextureId = SpecialMesh.TextureId
end
end
if MeshId then
for Index, Table in next, Accessories do
if Table.MeshId == MeshId and
Table.TextureId == TextureId then
local Handle = Table.Handle
tableinsert(Aligns, {
LastPosition =
Handle.Position,
Offset = CFrameidentity,
Part0 = Parent,
Part1 = Handle
})
return
end
end
for Index, Table in next, OptionsAccessories do
if stringfind(MeshId, Table.MeshId) and
stringfind(TextureId, Table.TextureId) then
local Instance = nil
local TableName = Table.Name
local TableNames = Table.Names
if TableName then
Instance =
FindFirstChildOfClassAndName(Rig, "BasePart", TableName)
else
for Index, TableName in next,
TableNames do
local Child =
FindFirstChildOfClassAndName(Rig, "BasePart", TableName)
if not
( TableNames[Index + 1] and Blacklist[Child] ) then
Instance = Child
break
end
end
end
if Instance then
local Blacklisted =
Blacklist[Instance]
Blacklist[Instance] =
{ MeshId = MeshId, TextureId = TextureId }
return
end
end
end
end
local Accoutrement =
FindFirstAncestorWhichIsA(Parent, "Accoutrement")
local HandleClone =
FindFirstChildOfClassAndName(AccoutrementClone, "BasePart", "Handle")
HandleClone.Transparency =
OptionsRigTransparency
for Index, Descendant in next,
GetDescendants(HandleClone) do
if IsA(Descendant, "JointInstance")
then
Destroy(Descendant)
end
end
AccoutrementClone.Parent = Rig
tableinsert(Accessories, {
Handle = HandleClone,
MeshId = MeshId,
TextureId = TextureId
})
tableinsert(Aligns, {
Offset = CFrameidentity,
Part0 = Parent,
Part1 = HandleClone
})
end
end
end
end
end
end
CurrentCamera.CameraSubject = RigHumanoid
Wait(PreRender)
CurrentCamera.CFrame = CameraCFrame +
RigHumanoidRootPart.CFrame.Position - Position
end
taskspawn(SetCameraSubject)
OnCameraSubjectChanged()
tableinsert(RBXScriptConnections,
Connect(GetPropertyChangedSignal(CurrentCamera, "CameraSubject"),
OnCameraSubjectChanged))
if OptionsSetCameraType then
OnCameraTypeChanged()
tableinsert(RBXScriptConnections,
Connect(GetPropertyChangedSignal(CurrentCamera, "CameraType"),
OnCameraTypeChanged))
end
end
end
return Child
end
return Child
end
if Highlight then
local HighlightObject = type(Highlight) == "boolean"
and Instancenew("Highlight") or Clone(Highlight)
HighlightObject.Adornee = Model
HighlightObject.Parent = Model
Options.HighlightObject = HighlightObject
tableinsert(Highlights, HighlightObject)
end
Targets[Target] = Options
Character = NewCharacter
if OptionsSetCameraSubject then
taskspawn(SetCameraSubject)
end
if OptionsSetCharacter then
taskdefer(SetCharacter)
end
if OptionsParentCharacter then
Character.Parent = Rig
end
if IsFirst then
if OptionsApplyDescription and Humanoid then
local AppliedDescription =
GetAppliedDescription(Humanoid)
SetAccessories(AppliedDescription, {}, true)
ApplyDescription(RigHumanoid, AppliedDescription)
end
if HumanoidRootPart then
RigHumanoidRootPart.CFrame = HumanoidRootPart.CFrame
if OptionsSetCollisionGroup then
local CollisionGroup =
HumanoidRootPart.CollisionGroup
IsFirst = false
end
if HumanoidRootPart then
for Target, Options in next, Targets do
if IsDescendantOf(Target, Workspace) then
local FirstPosition = Target.Position
local PredictionFling = Options.PredictionFling
local LastPosition = FirstPosition
local Timeout = osclock() + Options.Timeout or
1
if HumanoidRootPart then
while IsDescendantOf(Target, Workspace)
and osclock() < Timeout do
local DeltaTime = taskwait()
local Position = Target.Position
if ( Position -
FirstPosition ).Magnitude > 100 then
break
end
HumanoidRootPart.AssemblyAngularVelocity = FlingVelocity
HumanoidRootPart.AssemblyLinearVelocity = FlingVelocity
HumanoidRootPart.CFrame =
Target.CFrame + Offset
LastPosition = Position
end
end
end
if HighlightObject then
Destroy(HighlightObject)
end
Targets[Target] = nil
end
HumanoidRootPart.AssemblyAngularVelocity = Vector3zero
HumanoidRootPart.AssemblyLinearVelocity = Vector3zero
if OptionsHatDrop then
taskspawn(function()
WaitForChildOfClassAndName(Character,
"LocalScript", "Animate").Enabled = false
LoadAnimation(Humanoid, Humanoid.RigType == R6
and R6Animation or R15Animation):Play(0)
pcall(NewIndex, Workspace,
"FallenPartsDestroyHeight", nan)
local RootPartCFrame =
RigHumanoidRootPart.CFrame
RootPartCFrame = CFramenew(RootPartCFrame.X,
HatDropY, RootPartCFrame.Z)
while IsAlive do
HumanoidRootPart.AssemblyAngularVelocity
= Vector3zero
HumanoidRootPart.AssemblyLinearVelocity =
HatDropLinearVelocity
HumanoidRootPart.CFrame = RootPartCFrame
taskwait()
end
end)
elseif OptionsHideCharacter then
local RootPartCFrame = RigHumanoidRootPart.CFrame -
HideCharacterOffset
taskspawn(function()
while IsAlive do
HumanoidRootPart.AssemblyAngularVelocity
= Vector3zero
HumanoidRootPart.AssemblyLinearVelocity =
Vector3zero
HumanoidRootPart.CFrame = RootPartCFrame
taskwait()
end
end)
elseif OptionsTeleportRadius then
HumanoidRootPart.CFrame = RigHumanoidRootPart.CFrame
+ Vector3new(mathrandom(- OptionsTeleportRadius, OptionsTeleportRadius), 0,
mathrandom(- OptionsTeleportRadius, OptionsTeleportRadius))
end
end
taskwait(Players.RespawnTime + 0.1)
Refitting = false
replicatesignal(Kill)
else
taskwait(OptionsBreakJointsDelay)
end
ModelBreakJoints(Character)
if Humanoid then
ChangeState(Humanoid, Dead)
Wait(Humanoid.Died)
end
IsAlive = false
if OptionsHatDrop then
pcall(NewIndex, Workspace, "FallenPartsDestroyHeight",
FallenPartsDestroyHeight)
end
end
end
if Handle then
Part = Handle
break
end
end
end
end
if Part then
Exceptions[Part] = true
while IsMouseButtonPressed(UserInputService,
MouseButton1) do
if Part.ReceiveAge == 0 then
Part.AssemblyAngularVelocity =
FlingVelocity
Part.AssemblyLinearVelocity =
FlingVelocity
Part.CFrame = Mouse.Hit + AntiSleep
end
taskwait()
end
Exceptions[Part] = false
end
elseif ToolFling then
local Backpack = FindFirstChildOfClass(LocalPlayer,
"Backpack")
local Tool = nil
if Tool then
local Handle = FindFirstChildOfClassAndName(Tool,
"BasePart", "Handle") or FindFirstChildWhichIsA(Tool, "BasePart")
if Handle then
UnequipTools(Humanoid)
taskwait()
EquipTool(Humanoid, Tool)
while IsMouseButtonPressed(UserInputService,
MouseButton1) do
if Handle.ReceiveAge == 0 then
Handle.AssemblyAngularVelocity =
FlingVelocity
Handle.AssemblyLinearVelocity =
FlingVelocity
Handle.CFrame = Mouse.Hit +
AntiSleep
end
taskwait()
end
UnequipTools(Humanoid)
Handle.AssemblyAngularVelocity = Vector3zero
Handle.AssemblyLinearVelocity = Vector3zero
Handle.CFrame = RigHumanoidRootPart.CFrame
end
end
else
Fling(Target, OptionsDefaultFlingOptions)
end
end
end
if OptionsSimulationRadius then
pcall(SetSimulationRadius)
end
Part0.AssemblyAngularVelocity = Vector3zero
local LinearVelocity =
Part1.AssemblyLinearVelocity * Axis
Part0.AssemblyLinearVelocity =
Vector3new(LinearVelocity.X, Axis, LinearVelocity.Z)
Part0.CFrame = Part1.CFrame * Table.Offset +
AntiSleep
end
else
local Frames = Table.Frames or - 1
Frames = Frames + 1
Table.Frames = Frames
if IsRegistered then
SetCore(StarterGui, "ResetButtonCallback", BindableEvent)
else
IsRegistered = pcall(SetCore, StarterGui, "ResetButtonCallback",
BindableEvent)
end
end
if IsLockCenter then
PreRenderConnection = Connect(PreRender, OnPreRender)
tableinsert(RBXScriptConnections, PreRenderConnection)
elseif PreRenderConnection then
Disconnect(PreRenderConnection)
tableremove(RBXScriptConnections, tablefind(RBXScriptConnections,
PreRenderConnection))
end
end
local OnPreSimulation = function()
if OptionsDisableCharacterCollisions and Character then
for Index, Descendant in next, GetDescendants(Character) do
if IsA(Descendant, "BasePart") then
Descendant.CanCollide = false
end
end
end
if OptionsDisableRigCollisions then
for Index, Descendant in next, GetChildren(Rig) do
if IsA(Descendant, "BasePart") then
Descendant.CanCollide = false
end
end
end
end
Start = function(Options)
if not IsRunning then
IsFirst = true
IsRunning = true
Options = Options or {}
OptionsAccessories = Options.Accessories or {}
OptionsApplyDescription = Options.ApplyDescription
OptionsBreakJointsDelay = Options.BreakJointsDelay or 0
OptionsClickFling = Options.ClickFling
OptionsDisableCharacterCollisions =
Options.DisableCharacterCollisions
OptionsDisableHealthBar = Options.DisableHealthBar
OptionsDisableRigCollisions = Options.DisableRigCollisions
OptionsDefaultFlingOptions = Options.DefaultFlingOptions or {}
OptionsHatDrop = Options.HatDrop
OptionsHideCharacter = Options.HideCharacter
OptionsParentCharacter = Options.ParentCharacter
OptionsPermanentDeath = Options.PermanentDeath
OptionsRefit = Options.Refit
local OptionsRigSize = Options.RigSize
OptionsRigTransparency = Options.RigTransparency or 1
OptionsSetCameraSubject = Options.SetCameraSubject
OptionsSetCameraType = Options.SetCameraType
OptionsSetCharacter = Options.SetCharacter
OptionsSetCollisionGroup = Options.SetCollisionGroup
OptionsSimulationRadius = Options.SimulationRadius
OptionsTeleportRadius = Options.TeleportRadius
if OptionsDisableHealthBar then
IsHealthEnabled = GetCoreGuiEnabled(StarterGui, Health)
SetCoreGuiEnabled(StarterGui, Health, false)
end
BindableEvent = Instancenew("BindableEvent")
tableinsert(RBXScriptConnections, Connect(BindableEvent.Event,
Stop))
if OptionsRigSize then
ScaleTo(Rig, OptionsRigSize)
RigHumanoid.JumpPower = 50
RigHumanoid.WalkSpeed = 16
end
OnCurrentCameraChanged()
tableinsert(RBXScriptConnections, Connect(CurrentCameraChanged,
OnCurrentCameraChanged))
if OptionsClickFling then
tableinsert(RBXScriptConnections, Connect(InputBegan,
OnInputBegan))
end
if Character then
OnCharacterAdded(Character)
end
tableinsert(RBXScriptConnections, Connect(CharacterAdded,
OnCharacterAdded))
LastTime = osclock()
tableinsert(RBXScriptConnections, Connect(PostSimulation,
OnPostSimulation))
if OptionsDisableCharacterCollisions or
OptionsDisableRigCollisions then
OnPreSimulation()
tableinsert(RBXScriptConnections, Connect(PreSimulation,
OnPreSimulation))
end
return {
BindableEvent = BindableEvent,
Fling = Fling,
Rig = Rig
}
end
end
Stop = function()
if IsRunning then
IsFirst = false
IsRunning = false
tableclear(Highlights)
tableclear(RBXScriptConnections)
Destroy(BindableEvent)
if Humanoid then
ChangeState(Humanoid, Dead)
end
Destroy(Rig)
if IsRegistered then
pcall(SetCore, StarterGui, "ResetButtonCallback", true)
else
IsRegistered = pcall(SetCore, StarterGui,
"ResetButtonCallback", true)
end
end
end
end
Empyrean = Start({
Accessories = {
--{ MeshId = "", Name = "", Offset = CFrame.identity, TextureId = "" },