Professional Documents
Culture Documents
local lp = game:GetService("Players").LocalPlayer
local rs, ws, sg = game:GetService("RunService"), game:GetService("Workspace"),
game:GetService("StarterGui")
local stepped, heartbeat, renderstepped = rs.Stepped, rs.Heartbeat,
rs.RenderStepped
local twait, tdelay, rad, inf, abs, clamp = task.wait, task.delay, math.rad,
math.huge, math.abs, math.clamp
local cf, v3 = CFrame.new, Vector3.new
local angles = CFrame.Angles
local v3_0, cf_0 = v3(0, 0, 0), cf(0, 0, 0)
local c = lp.Character
if not (c and c.Parent) then
return
end
c:GetPropertyChangedSignal("Parent"):Connect(function()
if not (c and c.Parent) then
c = nil
end
end)
if alignmode == 4 then
else
Part0.CustomPhysicalProperties = physp
if (alignmode == 1) or (alignmode == 2) then
local ape = Instance.new("AlignPosition")
ape.MaxForce, ape.MaxVelocity, ape.Responsiveness = inf, inf, inf
ape.ReactionForceEnabled, ape.RigidityEnabled, ape.ApplyAtCenterOfMass
= false, true, false
ape.Attachment0, ape.Attachment1, ape.Name = att0, att1,
"AlignPositionRtrue"
ape.Parent = att0
end
local ao = Instance.new("AlignOrientation")
ao.MaxAngularVelocity, ao.MaxTorque, ao.Responsiveness = inf, inf, inf
ao.PrimaryAxisOnly, ao.ReactionTorqueEnabled, ao.RigidityEnabled = false,
false, false
ao.Attachment0, ao.Attachment1 = att0, att1
ao.Parent = att0
end
att0:GetPropertyChangedSignal("Parent"):Connect(function()
Part0 = att0.Parent
if not isa(Part0, "BasePart") then
att0 = nil
if lostpart == Part0 then
lostpart = nil
end
Part0 = nil
end
end)
att0.Parent = Part0
att1:GetPropertyChangedSignal("Parent"):Connect(function()
Part1 = att1.Parent
if not isa(Part1, "BasePart") then
att1 = nil
Part1 = nil
end
end)
att1.Parent = Part1
end
if antiragdoll then
antiragdoll = function(v)
if isa(v, "HingeConstraint") or isa(v, "BallSocketConstraint") then
v.Parent = nil
end
end
for i, v in pairs(getdescendants(c)) do
antiragdoll(v)
end
c.DescendantAdded:Connect(antiragdoll)
end
if antirespawn then
respawnrequest()
end
if method == 0 then
twait(loadtime)
if not c then
return
end
end
if discharscripts then
for i, v in pairs(getdescendants(c)) do
if isa(v, "LocalScript") then
v.Disabled = true
end
end
elseif newanimate then
local animate = gp(c, "Animate", "LocalScript")
if animate and (not animate.Disabled) then
animate.Disabled = true
else
newanimate = false
end
end
if addtools then
for i, v in pairs(getchildren(addtools)) do
if isa(v, "Tool") then
v.Parent = c
end
end
end
pcall(function()
settings().Physics.AllowSleep = false
settings().Physics.PhysicsEnvironmentalThrottle =
Enum.EnviromentalPhysicsThrottle.Disabled
end)
local OLDscripts = {}
for i, v in pairs(getdescendants(c)) do
if v.ClassName == "Script" then
OLDscripts[v.Name] = true
end
end
local scriptNames = {}
for i, v in pairs(getdescendants(c)) do
if isa(v, "BasePart") then
local newName, exists = tostring(i), true
while exists do
exists = OLDscripts[newName]
if exists then
newName = newName .. "_"
end
end
table.insert(scriptNames, newName)
Instance.new("Script", v).Name = newName
end
end
if not c then
return
end
local head, torso, root = gp(c, "Head", "BasePart"), gp(c, "Torso", "BasePart") or
gp(c, "UpperTorso", "BasePart"), gp(c, "HumanoidRootPart", "BasePart")
if hatcollide then
pcall(destroy, torso)
pcall(destroy, root)
pcall(destroy, c:FindFirstChildOfClass("BodyColors") or gp(c, "Health",
"Script"))
end
for i, v in pairs(getchildren(c)) do
if v ~= model then
if addtools and isa(v, "Tool") then
for i1, v1 in pairs(getdescendants(v)) do
if v1 and v1.Parent and isa(v1, "BasePart") then
local bv = Instance.new("BodyVelocity")
bv.Velocity, bv.MaxForce, bv.P, bv.Name = v3_0, v3(1000, 1000,
1000), 1250, "bv_" .. v.Name
bv.Parent = v1
end
end
end
v.Parent = model
end
end
if breakjoints then
model:BreakJoints()
else
if head and torso then
for i, v in pairs(getdescendants(model)) do
if isa(v, "JointInstance") then
local save = false
if (v.Part0 == torso) and (v.Part1 == head) then
save = true
end
if (v.Part0 == head) and (v.Part1 == torso) then
save = true
end
if save then
if hedafterneck then
hedafterneck = v
end
else
pcall(destroy, v)
end
end
end
end
if method == 3 then
task.delay(loadtime, pcall, model.BreakJoints, model)
end
end
cl.Parent = ws
for i, v in pairs(getchildren(cl)) do
v.Parent = c
end
pcall(destroy, cl)
for i, v in pairs(getdescendants(c)) do
if v and v.Parent and (not v:IsDescendantOf(model)) then
if isa(v, "Decal") then
v.Transparency = 1
elseif isa(v, "BasePart") then
v.Transparency = 1
v.Anchored = false
elseif isa(v, "ForceField") then
v.Visible = false
elseif isa(v, "Sound") then
v.Playing = false
elseif isa(v, "BillboardGui") or isa(v, "SurfaceGui") or isa(v,
"ParticleEmitter") or isa(v, "Fire") or isa(v, "Smoke") or isa(v, "Sparkles") then
v.Enabled = false
end
end
end
if newanimate then
local animate = gp(c, "Animate", "LocalScript")
if animate then
animate.Disabled = false
end
end
if addtools then
for i, v in pairs(getchildren(c)) do
if isa(v, "Tool") then
v.Parent = addtools
end
end
end
ws.CurrentCamera.CameraSubject = hum1
local camSubCon = nil
local function camSubFunc()
camSubCon:Disconnect()
if c and hum1 then
ws.CurrentCamera.CameraSubject = hum1
end
end
camSubCon = renderstepped:Connect(camSubFunc)
if hum0 then
hum0:GetPropertyChangedSignal("Jump"):Connect(function()
if hum1 then
hum1.Jump = hum0.Jump
end
end)
else
respawnrequest()
end
end
local rb = Instance.new("BindableEvent", c)
rb.Event:Connect(function()
pcall(destroy, rb)
sg:SetCore("ResetButtonCallback", true)
if destroyhum then
if c then c:BreakJoints() end
return
end
if model and hum0 and (hum0.Health > 0) then
model:BreakJoints()
hum0.Health = 0
end
if antirespawn then
respawnrequest()
end
end)
sg:SetCore("ResetButtonCallback", rb)
tdelay(0, function()
while c do
if hum0 and hum1 then
hum1.Jump = hum0.Jump
end
wait()
end
sg:SetCore("ResetButtonCallback", true)
end)
local lp = game:GetService("Players").LocalPlayer
local c = lp.Character
if not c then return end
local ws = game:GetService("Workspace")
c.AncestryChanged:Connect(function()
if not c:IsDescendantOf(ws) then
c = nil
end
end)
local rs = game:GetService("RunService")
local stepped, renderstepped, heartbeat = rs.Stepped, rs.RenderStepped,
rs.Heartbeat
local function gp(parent, name, classname)
if typeof(parent) == "Instance" then
for i, v in pairs(parent:GetChildren()) do
if (v.Name == name) and v:IsA(classname) then
return v
end
end
end
return nil
end
local RootJoint = {}
local RightShoulder = {}
local LeftShoulder = {}
local RightHip = {}
local LeftHip = {}
local Neck = {}
if mouse.Hit then
HumanoidRootPart.CFrame =
HumanoidRootPart.CFrame:Lerp(cf(HumanoidRootPart.Position, v3(mouse.Hit,X,
HumanoidRootPart.Position.Y, mouse.Hit.Z)), deltaTime)
end
end
else --idle
end
end)