Sniper
Sniper
fe sniper
made by MyWorld
discord.gg/pYVHtSJmEY
required hat: https://www.roblox.com/catalog/5063578607
]]
local lp = game:GetService("Players").LocalPlayer
local rs = game:GetService("RunService")
local stepped = rs.Stepped
local heartbeat = rs.Heartbeat
local renderstepped = rs.RenderStepped
local sg = game:GetService("StarterGui")
local ws = game:GetService("Workspace")
local cf = CFrame.new
local v3 = Vector3.new
local v3_0 = Vector3.zero
local inf = math.huge
local c = lp.Character
c:GetPropertyChangedSignal("Parent"):Connect(function()
if not (c and c.Parent) then
c = nil
end
end)
if getNetlessVelocity then
local vel = Part0.Velocity
local velpart = Part1
local rsteppedcon = renderstepped:Connect(function()
Part0.Velocity = vel
end)
local heartbeatcon = heartbeat:Connect(function()
vel = Part0.Velocity
Part0.Velocity = getNetlessVelocity(velpart.Velocity)
end)
local attcon = nil
Part0:GetPropertyChangedSignal("Parent"):Connect(function()
if not (Part0 and Part0.Parent) then
rsteppedcon:Disconnect()
heartbeatcon:Disconnect()
attcon:Disconnect()
end
end)
attcon = att1:GetPropertyChangedSignal("Parent"):Connect(function()
if not (att1 and att1.Parent) then
attcon:Disconnect()
velpart = Part0
else
velpart = att1.Parent
if not velpart:IsA("BasePart") then
velpart = Part0
end
end
end)
end
att0.Parent = Part0
att1.Parent = Part1
end
if antiragdoll then
for i, v in pairs(c:GetDescendants()) do
antiragdoll(v)
end
c.DescendantAdded:Connect(antiragdoll)
end
if antirespawn then
respawnrequest()
end
if method == 0 then
wait(loadtime)
if not c then
return
end
end
if discharscripts then
for i, v in pairs(c:GetChildren()) do
if v:IsA("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(addtools:GetChildren()) do
if v:IsA("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(c:GetDescendants()) do
if v.ClassName == "Script" then
table.insert(OLDscripts, v)
end
end
local scriptNames = {}
for i, v in pairs(c:GetDescendants()) do
if v:IsA("BasePart") then
local newName = tostring(i)
local exists = true
while exists do
exists = false
for i, v in pairs(OLDscripts) do
if v.Name == newName then
exists = true
end
end
if exists then
newName = newName .. "_"
end
end
table.insert(scriptNames, newName)
Instance.new("Script", v).Name = newName
end
end
c.Archivable = true
local hum = c:FindFirstChildOfClass("Humanoid")
if hum then
for i, v in pairs(hum:GetPlayingAnimationTracks()) do
v:Stop()
end
end
local cl = c:Clone()
if hum and humState16 then
hum:ChangeState(Enum.HumanoidStateType.Physics)
if destroyhum then
wait(1.6)
end
end
if hum and hum.Parent and destroyhum then
hum:Destroy()
end
if not c then
return
end
model:GetPropertyChangedSignal("Parent"):Connect(function()
if not (model and model.Parent) then
model = nil
end
end)
for i, v in pairs(c:GetChildren()) do
if v ~= model then
if addtools and v:IsA("Tool") then
for i1, v1 in pairs(v:GetDescendants()) do
if v1 and v1.Parent and v1:IsA("BasePart") then
local bv = Instance.new("BodyVelocity", v1)
bv.Velocity = v3_0
bv.MaxForce = v3(1000, 1000, 1000)
bv.P = 1250
bv.Name = "bv_" .. v.Name
end
end
end
v.Parent = model
end
end
if breakjoints then
model:BreakJoints()
else
if head and torso then
for i, v in pairs(model:GetDescendants()) do
if v:IsA("Weld") or v:IsA("Snap") or v:IsA("Glue") or
v:IsA("Motor") or v:IsA("Motor6D") 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
v:Destroy()
end
end
end
end
if method == 3 then
spawn(function()
wait(loadtime)
if model then
model:BreakJoints()
end
end)
end
end
cl.Parent = c
for i, v in pairs(cl:GetChildren()) do
v.Parent = c
end
cl:Destroy()
for i, v in pairs(c:GetDescendants()) do
if v and v.Parent and (not v:IsDescendantOf(model)) then
if v:IsA("Decal") then
v.Transparency = 1
elseif v:IsA("BasePart") then
v.Transparency = 1
v.Anchored = false
elseif v:IsA("ForceField") then
v.Visible = false
elseif v:IsA("Sound") then
v.Playing = false
elseif v:IsA("BillboardGui") or v:IsA("SurfaceGui") or
v:IsA("ParticleEmitter") or v:IsA("Fire") or v:IsA("Smoke") or v:IsA("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(c:GetChildren()) do
if v:IsA("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()
rb:Destroy()
sg:SetCore("ResetButtonCallback", true)
if destroyhum then
c:BreakJoints()
return
end
if hum0 and (hum0.Health > 0) then
model:BreakJoints()
hum0.Health = 0
end
if antirespawn then
respawnrequest()
end
end)
sg:SetCore("ResetButtonCallback", rb)
spawn(function()
while c do
if hum0 and hum1 then
hum1.Jump = hum0.Jump
end
wait()
end
sg:SetCore("ResetButtonCallback", true)
end)
--body parts
--rig joints
sniper:BreakJoints()
local fps = 60
local sinechange = 40 / fps
local event = Instance.new("BindableEvent", c)
event.Name = "renderstepped"
local floor = math.floor
fps = 1 / fps
local tf = 0
local con = nil
con = game:GetService("RunService").RenderStepped:Connect(function(s)
if not c then
con:Disconnect()
return
end
tf = tf + s
if tf >= fps then
for i=1, floor(tf / fps) do
tf = tf - fps
event:Fire(c)
end
end
end)
local event = event.Event
while event:Wait() do
sine = sine + sinechange
local vel = humanoidRootPart.Velocity
if not attack then
if vel.Magnitude < 2 then
--idle:
neck.C0 = neck.C0:Lerp(cf(0, 1, 0) * euler(-1.5882496193148399 +
0.08726646259971647 * sin((sine - 30) * 0.05), 0, -2.792526803190927 +
0.2617993877991494 * sin(sine * 0.0125)), 0.2)
rootJoint.C0 = rootJoint.C0:Lerp(cf(0, 0.1 * sin(sine * 0.05), 0) *
euler(-1.5882496193148399, 0, -3.490658503988659), 0.2)
leftShoulder.C0 = leftShoulder.C0:Lerp(cf(-1, 0.5, 0) *
euler(1.5707963267948966, -1.5882496193148399 + 0.08726646259971647 * sin((sine +
30) * 0.05), 1.5707963267948966 + 0.2617993877991494 * sin(sine * 0.0125)), 0.2)
rightShoulder.C0 = rightShoulder.C0:Lerp(cf(1, 1.4, 0) *
euler(1.7453292519943295 - 0.08726646259971647 * sin((sine + 30) * 0.05),
1.3962634015954636 + 0.08726646259971647 * sin((sine + 30) * 0.05),
0.8726646259971648), 0.2)
leftHip.C0 = leftHip.C0:Lerp(cf(-1, -1 - 0.1 * sin(sine * 0.05), 0) *
euler(0.3490658503988659, -1.7453292519943295, 0.5235987755982988), 0.2)
rightHip.C0 = rightHip.C0:Lerp(cf(1, -1 - 0.1 * sin(sine * 0.05), 0) *
euler(-0.3490658503988659, 1.3962634015954636, 0.5235987755982988), 0.2)
snipermotor.C0 = snipermotor.C0:Lerp(cf(-0.1 * sin(sine * 0.05), -2.4,
-0.4 - 0.1 * sin(sine * 0.05)) * euler(-1.5707963267948966 + 0.08726646259971647 *
sin(sine * 0.05), 1.5707963267948966 + 0.04363323129985824 * sin(sine * 0.05), -
0.17453292519943295), 0.2)
--local MW_animator_progressSave = "0, 0, 0, 0.1, -91, 5, -30, 0.05, 1,
0, 0, 0.1, 0, 0, 0, 0.1, 0, 0, 0, 0.1, -160, 15, 0, 0.0125, 0, 0, 0, 0.1, -91, 0,
0, 0.1, 0, 0.1, 0, 0.05, 0, 0, 0, 0.1, 0, 0, 0, 0.1, -200, 0, 0, 0.1, -1, 0, 0,
0.1, 90, 0, 0, 0.1, 0.5, 0, 0, 0.1, -91, 5, 30, 0.05, 0, 0, 0, 0.1, 90, 15, 0,
0.0125, 1, 0, 0, 0.1, 100, -5, 30, 0.05, 1.4, 0, 0, 0.1, 80, 5, 30, 0.05, 0, 0, 0,
0.1, 50, 0, 0, 0.1, -1, 0, 0, 0.1, 20, 0, 0, 0.1, -1, -0.1, 0, 0.05, -100, 0, 0,
0.1, 0, 0, 0, 0.1, 30, 0, 0, 0.1, 1, 0, 0, 0.1, -20, 0, 0, 0.1, -1, -0.1, 0, 0.05,
80, 0, 0, 0.1, 0, 0, 0, 0.1, 30, 0, 0, 0.1"
else
--walk:
neck.C0 = neck.C0:Lerp(cf(0, 1, 0) * euler(-1.6580627893946132 +
0.08726646259971647 * sin((sine + 5) * 0.4), 0, 3.141592653589793 -
0.08726646259971647 * sin(sine * 0.2)), 0.2)
rootJoint.C0 = rootJoint.C0:Lerp(cf(0, 0.15 + 0.1 * sin((sine - 7.5) *
0.4), 0) * euler(-1.6580627893946132, 0, -3.141592653589793 + 0.1308996938995747 *
sin(sine * 0.2)), 0.2)
leftShoulder.C0 = leftShoulder.C0:Lerp(cf(-1, 0.5 + 0.2 * sin((sine -
1.25) * 0.2), 0.3 * sin((sine - 5) * 0.2)) * euler(1.5707963267948966, -
1.3962634015954636, 0.5235987755982988 + 0.08726646259971647 * sin((sine - 1.25) *
0.2)), 0.2)
rightShoulder.C0 = rightShoulder.C0:Lerp(cf(1.2, 0.75 - 0.05 *
sin((sine + 5) * 0.4), -0.9) * euler(-1.9198621771937625 - 0.08726646259971647 *
sin((sine + 5) * 0.4), 2.9670597283903604, 1.7453292519943295 - 0.1308996938995747
* sin((sine - 5) * 0.2)), 0.2)
leftHip.C0 = leftHip.C0:Lerp(cf(-1, -1 + 0.2 * sin((sine - 5) * 0.2),
0) * euler(1.5707963267948966, -1.5707963267948966, 1.5707963267948966 +
0.6981317007977318 * sin(sine * 0.2)), 0.2)
rightHip.C0 = rightHip.C0:Lerp(cf(1, -1 - 0.2 * sin((sine - 5) * 0.2),
0) * euler(1.5707963267948966, 1.5707963267948966, -1.5707963267948966 +
0.6981317007977318 * sin(sine * 0.2)), 0.2)
snipermotor.C0 = snipermotor.C0:Lerp(cf(0, -2.4, -0.4 + 0.15 * sin(sine
* 0.2)) * euler(-1.5707963267948966 - 0.1308996938995747 * sin(sine * 0.2),
1.5707963267948966, -0.17453292519943295), 0.2)
--local MW_animator_progressSave = "0, 0, 0, 0.1, -95, 5, 5, 0.4, 1, 0,
0, 0.1, 0, 0, 0, 0.1, 0, 0, 0, 0.1, 180, -5, 0, 0.2, 0, 0, 0, 0.1, -95, 0, 0, 0.1,
0.15, 0.1, -7.5, 0.4, 0, 0, 0, 0.1, 0, 0, 0, 0.1, -180, 7.5, 0, 0.2, -1, 0, 0, 0.1,
90, 0, 0, 0.1, 0.5, 0.2, -1.25, 0.2, -80, 5, 30, 0, 0, 0.3, -5, 0.2, 30, 5, -1.25,
0.2, 1.2, 0, 0, 0.1, -110, -5, 5, 0.4, 0.75, -0.05, 5, 0.4, 170, 0, 30, 0, -0.9, 0,
0, 0.1, 100, -7.5, -5, 0.2, -1, 0, 0, 0.1, 90, 0, 0, 0.1, -1, 0.2, -5, 0.2, -90, 0,
0, 0.1, 0, 0, 0, 0.1, 90, 40, 0, 0.2, 1, 0, 0, 0.1, 90, 0, 0, 0.1, -1, -0.2, -5,
0.2, 90, 0, 0, 0.1, 0, 0, 0, 0.1, -90, 40, 0, 0.2"
end
end
end