Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local plr = game.Players.LocalPlayer
- local char = plr.Character
- local hum = char:FindFirstChildOfClass("Humanoid")
- local t = tick()
- local action = ""
- local torsorot = 0
- if hum:FindFirstChild("Animator") then
- hum.Animator:Destroy()
- end
- hum.WalkSpeed = 0
- function createJoint(wp0, wp1, wc0x, wc0y, wc0z, wc1x, wc1y, wc1z, name)
- local joint = Instance.new("Motor6D", wp0)
- joint.Part0 = wp0
- joint.Part1 = wp1
- joint.C0 = CFrame.new(wc0x, wc0y, wc0z)
- joint.C1 = CFrame.new(wc1x, wc1y, wc1z)
- joint.Name = name
- return joint
- end
- local RS = createJoint(char.Torso, char["Right Arm"], 1.5, 0.5, 0, 0, 0.5, 0, "Right Shoulder")
- local TS = createJoint(char.HumanoidRootPart, char.Torso, 0, 0, 0, 0, 0, 0, "RootJoint")
- local LS = createJoint(char.Torso, char["Left Arm"], -1.5, 0.5, 0, 0, 0.5, 0, "Left Shoulder")
- local RH = createJoint(char.Torso, char["Right Leg"], 0.5, -1, 0, 0, 1, 0, "Right Hip")
- local LH = createJoint(char.Torso, char["Left Leg"], -0.5, -1, 0, 0, 1, 0, "Left Hip")
- local NK = createJoint(char.Torso, char.Head, 0, 1, 0, 0, -1/2, 0, "Neck")
- local rsc0 = RS.C0
- local lsc0 = LS.C0
- local tsc0 = TS.C0
- local rhc0 = RH.C0
- local lhc0 = LH.C0
- local nkc0 = NK.C0
- TS.C0 = CFrame.new(0, 10000, 0)
- game:GetService("RunService").RenderStepped:connect(function()
- if action == "Sleep" then
- local speed = 1
- NK.C0 = NK.C0:lerp(nkc0 * CFrame.Angles(0, math.rad(10), 0), speed)
- TS.C0 = TS.C0:lerp(tsc0 * CFrame.new(0, -0.5, 1)
- * CFrame.Angles(math.rad(90), 0, 0), speed)
- RS.C0 = RS.C0:lerp(rsc0 * CFrame.Angles(0, 0, math.rad(60)), speed)
- LS.C0 = LS.C0:lerp(lsc0 * CFrame.Angles(0, 0, math.rad(-45)), speed)
- RH.C0 = RH.C0:lerp(rhc0 * CFrame.Angles(0, 0, math.rad(20)), speed)
- LH.C0 = LH.C0:lerp(lhc0 * CFrame.Angles(0, 0, math.rad(-40)), speed)
- elseif action == "WakeUp" then
- local speed = 0.3
- NK.C0 = NK.C0:lerp(nkc0 * CFrame.Angles(math.rad(-10), 0, 0), speed)
- TS.C0 = TS.C0:lerp(tsc0 * CFrame.new(0, 0, 0.5), speed)
- RS.C0 = RS.C0:lerp(rsc0 * CFrame.Angles(0, 0, math.rad(-20)), speed)
- LS.C0 = LS.C0:lerp(lsc0 * CFrame.Angles(0, 0, math.rad(20)), speed)
- RH.C0 = RH.C0:lerp(rhc0 * CFrame.Angles(math.rad(90), 0, math.rad(20)), speed)
- LH.C0 = LH.C0:lerp(lhc0 * CFrame.Angles(math.rad(90), 0, math.rad(-20)), speed)
- end
- end)
- local bed = Instance.new("Part", char)
- bed.Anchored = false
- bed.CanCollide = false
- bed.Size = Vector3.new(4, 8, 2)
- bed:BreakJoints()
- local bedmesh = Instance.new("SpecialMesh", bed)
- bedmesh.Scale = Vector3.new(0.4, 0.5, 0.4)
- bedmesh.MeshId = "rbxassetid://473508427"
- bedmesh.TextureId = "rbxassetid://473508936"
- local bedweld = Instance.new("Weld", bed)
- bedweld.Part0 = char.HumanoidRootPart
- bedweld.Part1 = bed
- bedweld.C0 = CFrame.new(0, -1.35, 1) * CFrame.Angles(0, math.rad(-180), 0)
- * CFrame.Angles(math.rad(-90), 0, 0)
- action = "Sleep"
- wait(0.25)
- action = "WakeUp"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement