Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- repeat wait() until #game:GetService("Players"):GetPlayers() > 0
- local coms = {Instance.new("RemoteEvent",script),Instance.new("RemoteFunction",script)}
- local owner = owner or game:GetService("Players"):WaitForChild("plytalent")
- local FF = Instance.new("ForceField",owner.Character)
- local waitremote = Instance.new('RemoteEvent',script)
- local char = Instance.new('ObjectValue',script)
- char.Name = "CharacterObjectValue"
- function createFakeCharacter(DisplayName)
- local Model0 = Instance.new("Model")
- local Part1 = Instance.new("Part")
- local SpecialMesh2 = Instance.new("SpecialMesh")
- local Part3 = Instance.new("Part")
- local Part4 = Instance.new("Part")
- local Part5 = Instance.new("Part")
- local Part6 = Instance.new("Part")
- local Part7 = Instance.new("Part")
- local Humanoid8 = Instance.new("Humanoid")
- local Part9 = Instance.new("Part")
- local CharacterMesh10 = Instance.new("CharacterMesh")
- local Shirt11 = Instance.new("Shirt")
- local Pants12 = Instance.new("Pants")
- local Part13 = Instance.new("Part")
- local SpecialMesh14 = Instance.new("SpecialMesh")
- local AlignOrientation15 = Instance.new("AlignOrientation")
- local AlignPosition16 = Instance.new("AlignPosition")
- local Part17 = Instance.new("Part")
- local SpecialMesh18 = Instance.new("SpecialMesh")
- local AlignOrientation19 = Instance.new("AlignOrientation")
- local AlignPosition20 = Instance.new("AlignPosition")
- local Attachment21 = Instance.new("Attachment")
- local Attachment22 = Instance.new("Attachment")
- local Attachment23 = Instance.new("Attachment")
- Attachment21.Name = "Head"
- Attachment22.Name = "Hair"
- Attachment23.Name = "Mask"
- Attachment21.Parent = Part1
- Attachment22.Parent = Part17
- Attachment23.Parent = Part13
- Model0.Name = "Ghost"
- Model0.PrimaryPart = Part9
- Part1.Name = "Head"
- Part1.Parent = Model0
- Part1.CFrame = CFrame.new(-51.5, 4.5, -53, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part1.Position = Vector3.new(-51.5, 4.5, -53)
- Part1.Color = Color3.new(0.972549, 0.972549, 0.972549)
- Part1.Size = Vector3.new(2, 1, 1)
- Part1.BrickColor = BrickColor.new("Institutional white")
- Part1.Material = Enum.Material.Sand
- Part1.TopSurface = Enum.SurfaceType.Smooth
- Part1.brickColor = BrickColor.new("Institutional white")
- Part1.FormFactor = Enum.FormFactor.Symmetric
- Part1.formFactor = Enum.FormFactor.Symmetric
- SpecialMesh2.Parent = Part1
- SpecialMesh2.Scale = Vector3.new(1.25, 1.25, 1.25)
- Part3.Name = "Torso"
- Part3.Parent = Model0
- Part3.CFrame = CFrame.new(-51.5, 3, -53, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part3.Position = Vector3.new(-51.5, 3, -53)
- Part3.Color = Color3.new(0.972549, 0.972549, 0.972549)
- Part3.Size = Vector3.new(2, 2, 1)
- Part3.BrickColor = BrickColor.new("Institutional white")
- Part3.LeftParamA = 0
- Part3.LeftParamB = 0
- Part3.LeftSurface = Enum.SurfaceType.Weld
- Part3.Material = Enum.Material.Sand
- Part3.RightParamA = 0
- Part3.RightParamB = 0
- Part3.RightSurface = Enum.SurfaceType.Weld
- Part3.brickColor = BrickColor.new("Institutional white")
- Part3.FormFactor = Enum.FormFactor.Symmetric
- Part3.formFactor = Enum.FormFactor.Symmetric
- Part4.Name = "Left Arm"
- Part4.Parent = Model0
- Part4.CFrame = CFrame.new(-53, 3, -53, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part4.Position = Vector3.new(-53, 3, -53)
- Part4.Color = Color3.new(0.972549, 0.972549, 0.972549)
- Part4.Size = Vector3.new(1, 2, 1)
- Part4.BrickColor = BrickColor.new("Institutional white")
- Part4.CanCollide = false
- Part4.Material = Enum.Material.Sand
- Part4.brickColor = BrickColor.new("Institutional white")
- Part4.FormFactor = Enum.FormFactor.Symmetric
- Part4.formFactor = Enum.FormFactor.Symmetric
- Part5.Name = "Right Arm"
- Part5.Parent = Model0
- Part5.CFrame = CFrame.new(-50, 3, -53, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part5.Position = Vector3.new(-50, 3, -53)
- Part5.Color = Color3.new(0.972549, 0.972549, 0.972549)
- Part5.Size = Vector3.new(1, 2, 1)
- Part5.BrickColor = BrickColor.new("Institutional white")
- Part5.CanCollide = false
- Part5.Material = Enum.Material.Sand
- Part5.brickColor = BrickColor.new("Institutional white")
- Part5.FormFactor = Enum.FormFactor.Symmetric
- Part5.formFactor = Enum.FormFactor.Symmetric
- Part6.Name = "Left Leg"
- Part6.Parent = Model0
- Part6.CFrame = CFrame.new(-52, 1, -53, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part6.Position = Vector3.new(-52, 1, -53)
- Part6.Color = Color3.new(0.972549, 0.972549, 0.972549)
- Part6.Size = Vector3.new(1, 2, 1)
- Part6.BottomSurface = Enum.SurfaceType.Smooth
- Part6.BrickColor = BrickColor.new("Institutional white")
- Part6.CanCollide = false
- Part6.Material = Enum.Material.Sand
- Part6.brickColor = BrickColor.new("Institutional white")
- Part6.FormFactor = Enum.FormFactor.Symmetric
- Part6.formFactor = Enum.FormFactor.Symmetric
- Part7.Name = "Right Leg"
- Part7.Parent = Model0
- Part7.CFrame = CFrame.new(-51, 1, -53, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part7.Position = Vector3.new(-51, 1, -53)
- Part7.Color = Color3.new(0.972549, 0.972549, 0.972549)
- Part7.Size = Vector3.new(1, 2, 1)
- Part7.BottomSurface = Enum.SurfaceType.Smooth
- Part7.BrickColor = BrickColor.new("Institutional white")
- Part7.CanCollide = false
- Part7.Material = Enum.Material.Sand
- Part7.brickColor = BrickColor.new("Institutional white")
- Part7.FormFactor = Enum.FormFactor.Symmetric
- Part7.formFactor = Enum.FormFactor.Symmetric
- Humanoid8.Parent = Model0
- Humanoid8.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
- Humanoid8.HealthDisplayDistance = 0
- Humanoid8.HealthDisplayType = Enum.HumanoidHealthDisplayType.AlwaysOff
- Humanoid8.LeftLeg = Part6
- Humanoid8.NameDisplayDistance = 0
- Humanoid8.RightLeg = Part7
- Humanoid8.Torso = Part9
- Part9.Name = "HumanoidRootPart"
- Part9.Parent = Model0
- Part9.CFrame = CFrame.new(-51.5, 3, -53, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part9.Position = Vector3.new(-51.5, 3, -53)
- Part9.Transparency = 1
- Part9.Size = Vector3.new(2, 2, 1)
- Part9.Anchored = false
- Part9.BottomSurface = Enum.SurfaceType.Smooth
- Part9.CanCollide = false
- Part9.LeftParamA = 0
- Part9.LeftParamB = 0
- Part9.Material = Enum.Material.Sand
- Part9.RightParamA = 0
- Part9.RightParamB = 0
- Part9.TopSurface = Enum.SurfaceType.Smooth
- Part9.FormFactor = Enum.FormFactor.Symmetric
- Part9.formFactor = Enum.FormFactor.Symmetric
- CharacterMesh10.Parent = Model0
- CharacterMesh10.BodyPart = Enum.BodyPart.Torso
- CharacterMesh10.MeshId = "rbxassetid://48112070"
- Shirt11.Name = "Shirt"
- Shirt11.Parent = Model0
- Shirt11.ShirtTemplate = "http://www.roblox.com/asset/?id=1210857659"
- Pants12.Name = "Pants"
- Pants12.Parent = Model0
- Pants12.PantsTemplate = "http://www.roblox.com/asset/?id=1210858273"
- Part13.Name = "Mask"
- Part13.Parent = Model0
- Part13.CFrame = CFrame.new(-51.5017433, 4.50454998, -53.0024185, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part13.Position = Vector3.new(-51.50174331665, 4.5045499801636, -53.002418518066)
- Part13.Size = Vector3.new(2, 1, 1)
- Part13.BottomSurface = Enum.SurfaceType.Smooth
- Part13.CanCollide = false
- Part13.Material = Enum.Material.Sand
- Part13.TopSurface = Enum.SurfaceType.Smooth
- SpecialMesh14.Name = "SpecialMesh"
- SpecialMesh14.Parent = Part13
- SpecialMesh14.MeshId = "rbxassetid://5728632913"
- SpecialMesh14.TextureId = "http://www.roblox.com/asset/?id=4809181158"
- SpecialMesh14.MeshType = Enum.MeshType.FileMesh
- AlignOrientation15.Parent = Part13
- AlignOrientation15.Attachment0 = Attachment22
- AlignOrientation15.Attachment1 = Attachment21
- AlignOrientation15.RigidityEnabled = true
- AlignPosition16.Parent = Part13
- AlignPosition16.Attachment0 = Attachment22
- AlignPosition16.Attachment1 = Attachment21
- AlignPosition16.RigidityEnabled = true
- Part17.Name = "Hair"
- Part17.Parent = Model0
- Part17.CFrame = CFrame.new(-51.5, 4.5, -53, 1, 9.8568377e-15, -8.08289872e-16, -9.82961152e-15, 0.999588966, 0.0286718253, 1.09057112e-15, -0.0286718253, 0.999588966)
- Part17.Orientation = Vector3.new(-1.6399999856949, 0, 0)
- Part17.Position = Vector3.new(-51.5, 4.5, -53)
- Part17.Rotation = Vector3.new(-1.6399999856949, 0, 0)
- Part17.Size = Vector3.new(2, 1, 1)
- Part17.BottomSurface = Enum.SurfaceType.Smooth
- Part17.CanCollide = false
- Part17.Material = Enum.Material.Sand
- Part17.TopSurface = Enum.SurfaceType.Smooth
- SpecialMesh18.Name = "SpecialMesh"
- SpecialMesh18.Parent = Part17
- SpecialMesh18.MeshId = "rbxassetid://6521980205"
- SpecialMesh18.Offset = Vector3.new(0, -0.80000001192093, 0.20000000298023)
- SpecialMesh18.Scale = Vector3.new(0.94999998807907, 0.95999997854233, 0.91000002622604)
- SpecialMesh18.TextureId = "http://www.roblox.com/asset/?id=6517665515"
- SpecialMesh18.MeshType = Enum.MeshType.FileMesh
- AlignOrientation19.Parent = Part17
- AlignOrientation19.Attachment0 = Attachment23
- AlignOrientation19.Attachment1 = Attachment21
- AlignOrientation19.RigidityEnabled = true
- AlignPosition20.Parent = Part17
- AlignPosition20.Attachment0 = Attachment23
- AlignPosition20.Attachment1 = Attachment21
- AlignPosition20.RigidityEnabled = true
- return Model0
- end
- local mainchar = createFakeCharacter(owner.DisplayName)
- local conchar = mainchar:Clone()
- FF.Visible = false
- local comsfuncs={
- function(plr, partname, partposition, partsize, partorientation)
- if plr ~= owner then
- return
- end
- if owner.Character.Parent then
- owner.Character.Parent = nil
- end
- if not conchar then
- conchar = mainchar:Clone()
- conchar.Parent = workspace
- return
- end
- if not conchar.Parent then
- conchar=nil
- return
- end
- if FF.Parent ~= owner.Character then
- FF = Instance.new("ForceField",owner.Character)
- FF.Visible = false
- end
- conchar.Name = "Ghost"
- local part = conchar:FindFirstChild(partname)
- if not part then
- conchar:Destroy()
- conchar = nil
- return
- end
- if conchar and char.Value ~= conchar then
- char.Value = conchar
- end
- for _,p in pairs(conchar:GetDescendants()) do
- if p:IsA("BasePart") then
- if p:GetNetworkOwner() ~= owner then
- p:SetNetworkOwner(owner)
- end
- if not p.Massless then
- p.Massless = true
- end
- end
- end
- if part then
- if not part:FindFirstChild("PartAlignPos") then
- part.Position = partposition
- local AlignPosition = Instance.new("AlignPosition",part)
- local AlignOrientation = Instance.new("AlignOrientation",part)
- AlignPosition.Name = "PartAlignPos"
- AlignOrientation.Name = "PartAlignOri"
- local attachment0 = Instance.new("Attachment",part)
- local attachment1 = Instance.new("Attachment",part)
- attachment1.Name = "attachment1"
- AlignOrientation.RigidityEnabled = true
- AlignPosition.RigidityEnabled = true
- AlignOrientation.Attachment0 = attachment0
- AlignOrientation.Attachment1 = attachment1
- AlignPosition.Attachment0 = attachment0
- AlignPosition.Attachment1 = attachment1
- end
- if partname == "HumanoidRootPart" then
- part.Transparency = 1
- else
- part.Transparency = 0.5
- end
- part.Name = partname
- if part:GetNetworkOwner() ~= owner then
- part:SetNetworkOwner(owner)
- end
- end
- end,
- function(plr)
- if plr ~= owner then
- return
- end
- return conchar
- end
- }
- coms[1].Name = "Com1"
- coms[2].Name = "Com2"
- waitremote.Name = "WaitRemote"
- coms[2].OnServerInvoke = comsfuncs[2]
- coms[1].OnServerEvent:Connect(comsfuncs[1])
- NLS([==[
- local remote=script.Parent.Com1
- local com1 = script.Parent.Com2
- local owner = owner or game:GetService("Players").LocalPlayer
- local Teleported = false
- game:GetService("RunService").RenderStepped:Connect(function()
- if owner.Character.Parent ~= workspace then
- owner.Character.Parent = workspace
- end
- end)
- local parttable={}
- local FF
- game:GetService("RunService").Stepped:Connect(function()
- if not FF then
- FF = Instance.new("ForceField")
- end
- if not FF.Parent then
- FF = nil
- end
- if FF then
- FF.Visible = false
- end
- for _, part in pairs(owner.Character:GetChildren()) do
- coroutine.resume(coroutine.create(function()
- local part = part
- if part:IsA("BasePart") then
- remote:FireServer(part.Name, part.Position, part.Size, part.Orientation)
- end
- end))
- end
- end)
- game:GetService("RunService").RenderStepped:Connect(function()
- if com1:InvokeServer() then
- for _,part in pairs(com1:InvokeServer():GetDescendants()) do
- coroutine.resume(coroutine.create(function()
- if part:IsA("BasePart") then
- part.CanCollide = false
- if part:FindFirstChild("attachment1") then
- part.attachment1.Parent = owner.Character[part.Name]
- part.Position = owner.Character[part.Name].Position
- else
- if owner.Character:FindFirstChild(part.Name) then
- if not Teleported then
- part.PartAlignPos.RigidityEnabled = not part.PartAlignPos.RigidityEnabled
- end
- end
- end
- elseif part:IsA("Humanoid") then
- part:Destroy()
- end
- end))
- end
- end
- end)
- local player = owner or game:GetService("Players").LocalPlayer
- local mouse = player:GetMouse()
- mouse.KeyDown:Connect(function(k)
- if k == "n" then
- player.Character:SetPrimaryPartCFrame(mouse.Hit * CFrame.new(0,4,0))
- Teleported = true
- wait(1)
- Teleported = false
- end
- end)
- script.Parent.WaitRemote:FireServer()
- ]==],script)
- game:GetService("RunService").Heartbeat:Connect(function()
- for i=1,#coms do
- if not coms[i].Parent then
- local ClassName = coms[i].ClassName
- coms[i] = Instance.new(ClassName,script)
- if ClassName == "RemoteEvent" then
- coms[i].OnServerEvent:Connect(comsfuncs[i])
- elseif ClassName == "RemoteFunction" then
- coms[i].OnServerInvoke = comsfuncs[i]
- end
- end
- if coms[i].Name ~= "Com" .. tostring(i) then
- coms[i].Name = "Com" .. tostring(i)
- end
- end
- end)
- script.Parent = owner.PlayerGui
- print("waiting")
- waitremote.OnServerEvent:Wait()
- print("Destroy! wait remote")
- waitremote:Destroy()
- owner.Character.Parent = nil
- local rolandscript=NS([===[
- local part = nil
- local dwn = false
- local mouse_fd = Instance.new("Folder",script)
- mouse_fd.Name = "Mouse"
- local m1d,m1u,kd,updateposition = Instance.new("RemoteEvent",mouse_fd), Instance.new("RemoteEvent",mouse_fd), Instance.new("RemoteEvent",mouse_fd), Instance.new("RemoteEvent",mouse_fd)
- m1d.Name = "Button1Down"
- m1u.Name = "Button1Up"
- kd.Name = "KeyDown"
- local oldownership = nil
- updateposition.Name = "Update_Hit_Target"
- local mouse = {
- ["Button1Down"]=m1d.OnServerEvent,
- ["Button1Up"]=m1u.OnServerEvent,
- ["KeyDown"]=kd.OnServerEvent,
- Hit = CFrame.new(0,0,0),
- Target = nil
- }
- updateposition.OnServerEvent:Connect(function(plr,hit,target)
- if plr ~= owner then
- return
- end
- mouse.hit = hit
- mouse.Hit = hit
- mouse.target = target
- mouse.Target = target
- end)
- mouse.KeyDown:Connect(function(plr,k)
- if plr ~= owner then
- return
- end
- if k == "t" and part ~= nil then
- local clone = part:Clone()
- clone.Parent = workspace
- clone.Anchored = false
- clone:ClearAllChildren()
- clone.CanCollide = true
- bp.Parent = clone
- if part.Parent:FindFirstChildOfClass("Humanoid") then
- part.Parent:FindFirstChildOfClass("Humanoid").PlatformStand = false
- end
- part:Destroy()
- part = clone
- end
- end)
- mouse.Button1Down:Connect(function(plr)
- if plr ~= owner then
- return
- end
- if mouse ~= nil then
- if mouse.Target ~= nil then
- part = mouse.Target
- if not part.Anchored and part:IsDescendantOf(workspace) then
- oldownership = part:GetNetworkOwner()
- end
- bp = Instance.new("BodyPosition",part)
- bp.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
- bp.Position = part.Position
- dwn = true
- end
- end
- while dwn do
- game:GetService("RunService").Stepped:Wait()
- bp.Position = mouse.Hit.p
- if part then
- if not part.Anchored and part:IsDescendantOf(workspace) then
- if part:GetNetworkOwner() ~= owner then
- part:SetNetworkOwner(owner)
- end
- end
- if part.Parent:FindFirstChildOfClass("Humanoid") then
- part.Parent:FindFirstChildOfClass("Humanoid").PlatformStand = true
- end
- end
- end
- end)
- mouse.Button1Up:Connect(function(plr)
- if plr ~= owner then
- return
- end
- dwn = false
- if part then
- if part.Parent:FindFirstChildOfClass("Humanoid") then
- part.Parent:FindFirstChildOfClass("Humanoid").PlatformStand = false
- end
- if not part.Anchored and part:IsDescendantOf(workspace) then
- if part:GetNetworkOwner() ~= oldownership then
- part:SetNetworkOwner(oldownership)
- end
- end
- part = nil
- end
- if bp then
- bp:Destroy()
- end
- end)
- NLS([====[
- local UpdateMouse = script.Parent.Mouse.Update_Hit_Target
- local M1Down = script.Parent.Mouse.Button1Down
- local M1Up = script.Parent.Mouse.Button1Up
- local KDown = script.Parent.Mouse.KeyDown
- local mouse = owner:GetMouse()
- local lasthit,lasttarget = mouse.Hit,mouse.Target
- mouse.KeyDown:Connect(function(k)
- KDown:FireServer(k)
- end)
- mouse.Button1Down:Connect(function()
- M1Down:FireServer()
- end)
- mouse.Button1Up:Connect(function()
- M1Up:FireServer()
- end)
- game:GetService("RunService").Heartbeat:Connect(function()
- if mouse.Hit ~= lasthit or mouse.Target ~=lasttarget then
- UpdateMouse:FireServer(mouse.Hit,mouse.Target)
- end
- end)
- ]====],script)
- print("Ready!")
- ]===],script)
- rolandscript.Name = "Force"
- local animationroland = NLS([=[
- local Player = owner or game:GetService("Players").LocalPlayer
- local Character = Player.Character
- local Torso = Character.Torso
- local Humanoid = Character.Humanoid
- local LeftArm = Character["Left Arm"]
- local LeftLeg = Character["Left Leg"]
- local RightArm = Character["Right Arm"]
- local RightLeg = Character["Right Leg"]
- local LS = Torso["Left Shoulder"]
- local LH = Torso["Left Hip"]
- local RS = Torso["Right Shoulder"]
- local RH = Torso["Right Hip"]
- local Neck = Torso.Neck
- local RootPart = Character.HumanoidRootPart
- local RootJoint = RootPart.RootJoint
- local cf = CFrame.new
- local angles = CFrame.Angles
- local ROOTC0 = RootJoint.C0
- local NECKC0 = Torso.Neck.C0
- local COS = math.cos
- local ACOS = math.acos
- local SIN = math.sin
- local ASIN = math.asin
- local ABS = math.abs
- local MRANDOM = math.random
- local FLOOR = math.floor
- local euler=CFrame.fromEulerAnglesXYZ
- local angles=CFrame.Angles
- RW, LW=Instance.new("Weld"), Instance.new("Weld")
- RW.Name="Right Shoulder" LW.Name="Left Shoulder"
- LH=Torso["Left Hip"]
- RH=Torso["Right Hip"]
- RootCF=euler(-1.57,0,3.14)
- necko=cf(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
- RSH=Character.Torso["Right Shoulder"]
- LSH=Character.Torso["Left Shoulder"]
- RSH.Parent=nil
- LSH.Parent=nil
- RW.Name="Right Shoulder"
- RW.Part0=Character.Torso
- RW.C0=cf(1.5, 0.5, 0)
- RW.C1=cf(0, 0.5, 0)
- RW.Part1=Character["Right Arm"]
- RW.Parent=Character.Torso
- LW.Name="Left Shoulder"
- LW.Part0=Character.Torso
- LW.C0=cf(-1.5, 0.5, 0)
- LW.C1=cf(0, 0.5, 0)
- LW.Part1=Character["Left Arm"]
- LW.Parent=Character.Torso
- function QuaternionSlerp(a, b, t)
- local cosTheta = a[1]*b[1] + a[2]*b[2] + a[3]*b[3] + a[4]*b[4]
- local startInterp, finishInterp;
- if cosTheta >= 0.0001 then
- if (1 - cosTheta) > 0.0001 then
- local theta = math.acos(cosTheta)
- local invSinTheta = 1/math.sin(theta)
- startInterp = math.sin((1-t)*theta)*invSinTheta
- finishInterp = math.sin(t*theta)*invSinTheta
- else
- startInterp = 1-t
- finishInterp = t
- end
- else
- if (1+cosTheta) > 0.0001 then
- local theta = math.acos(-cosTheta)
- local invSinTheta = 1/math.sin(theta)
- startInterp = math.sin((t-1)*theta)*invSinTheta
- finishInterp = math.sin(t*theta)*invSinTheta
- else
- startInterp = t-1
- finishInterp = t
- end
- end
- return a[1]*startInterp + b[1]*finishInterp, a[2]*startInterp + b[2]*finishInterp, a[3]*startInterp + b[3]*finishInterp, a[4]*startInterp + b[4]*finishInterp
- end
- function Clerp(a,b,t)
- local qa = {QuaternionFromCFrame(a)}
- local qb = {QuaternionFromCFrame(b)}
- local ax, ay, az = a.x, a.y, a.z
- local bx, by, bz = b.x, b.y, b.z
- local _t = 1-t
- return QuaternionToCFrame(_t*ax + t*bx, _t*ay + t*by, _t*az + t*bz,QuaternionSlerp(qa, qb, t))
- end
- function QuaternionFromCFrame(cf)
- local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
- local trace = m00 + m11 + m22
- if trace > 0 then
- local s = math.sqrt(1 + trace)
- local recip = 0.5/s
- return (m21-m12)*recip, (m02-m20)*recip, (m10-m01)*recip, s*0.5
- else
- local i = 0
- if m11 > m00 then
- i = 1
- end
- if m22 > (i == 0 and m00 or m11) then
- i = 2
- end
- if i == 0 then
- local s = math.sqrt(m00-m11-m22+1)
- local recip = 0.5/s
- return 0.5*s, (m10+m01)*recip, (m20+m02)*recip, (m21-m12)*recip
- elseif i == 1 then
- local s = math.sqrt(m11-m22-m00+1)
- local recip = 0.5/s
- return (m01+m10)*recip, 0.5*s, (m21+m12)*recip, (m02-m20)*recip
- elseif i == 2 then
- local s = math.sqrt(m22-m00-m11+1)
- local recip = 0.5/s return (m02+m20)*recip, (m12+m21)*recip, 0.5*s, (m10-m01)*recip
- end
- end
- end
- function QuaternionToCFrame(px, py, pz, x, y, z, w)
- local xs, ys, zs = x + x, y + y, z + z
- local wx, wy, wz = w*xs, w*ys, w*zs
- local xx = x*xs
- local xy = x*ys
- local xz = x*zs
- local yy = y*ys
- local yz = y*zs
- local zz = z*zs
- return CFrame.new(px, py, pz,1-(yy+zz), xy - wz, xz + wy,xy + wz, 1-(xx+zz), yz - wx, xz - wy, yz + wx, 1-(xx+yy))
- end
- local function CFrameFromTopBack(at, top, back)
- local right = top:Cross(back)
- return CFrame.new(
- at.x, at.y, at.z,
- right.x, top.x, back.x,
- right.y, top.y, back.y,
- right.z, top.z, back.z
- )
- end
- function rayCast(Pos, Dir, Max, Ignore)
- return game:service("Workspace"):FindPartOnRayWithIgnoreList(Ray.new(Pos, Dir.unit * (Max or math.huge)), Ignore)
- end
- local destroy_animate = true
- local currentsine = 0
- function animation(sine)
- local torvel=(RootPart.Velocity*Vector3.new(1,0,1)).magnitude
- local hitfloor,posfloor=rayCast(RootPart.Position,(CFrame.new(RootPart.Position,RootPart.Position - Vector3.new(0,1,0))).lookVector,4,{Character, script.Parent.Parent.CharacterObjectValue.Value})
- if hitfloor then
- if Character:FindFirstChild("Animate") and destroy_animate then
- destroy_animate=false
- wait(1)
- Character:FindFirstChild("Animate"):Destroy()
- end
- end
- if RootPart.Velocity.y > 1 and hitfloor==nil then
- RH.C0=Clerp(RH.C0,cf(1,-1 - 0.05 * math.cos(sine/25),0)*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(-5),math.rad(0),math.rad(-20)),.1)
- LH.C0=Clerp(LH.C0,cf(-1,-1 - 0.05 * math.cos(sine/25),0)*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(-5),math.rad(0),math.rad(20)),.1)
- RootJoint.C0=Clerp(RootJoint.C0,RootCF*cf(0,0,0 + 0.05 * math.cos(sine/25))*angles(math.rad(-10),math.rad(0),math.rad(0)),.1)
- Torso.Neck.C0=Clerp(Torso.Neck.C0,necko*angles(math.rad(-2.5),math.rad(0),math.rad(0)),.1)
- RW.C0=Clerp(RW.C0,cf(1.45,0.5 + 0.1 * math.cos(sine/25),0)*angles(math.rad(-5),math.rad(0),math.rad(25)),.1)
- LW.C0=Clerp(LW.C0,cf(-1.45,0.5 + 0.1 * math.cos(sine/25),0)*angles(math.rad(-5),math.rad(0),math.rad(-25)),.1)
- elseif RootPart.Velocity.y < -1 and hitfloor==nil then
- RH.C0=Clerp(RH.C0,cf(1,-1 - 0.05 * math.cos(sine/25),0)*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(-5),math.rad(0),math.rad(-20)),.1)
- LH.C0=Clerp(LH.C0,cf(-1,-1 - 0.05 * math.cos(sine/25),0)*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(-5),math.rad(0),math.rad(20)),.1)
- RootJoint.C0=Clerp(RootJoint.C0,RootCF*cf(0,0,0 + 0.05 * math.cos(sine/25))*angles(math.rad(0),math.rad(0),math.rad(0)),.1)
- Torso.Neck.C0=Clerp(Torso.Neck.C0,necko*angles(math.rad(0),math.rad(0),math.rad(0)),.1)
- RW.C0=Clerp(RW.C0,cf(1.45,0.5 + 0.1 * math.cos(sine/25),0)*angles(math.rad(-20),math.rad(0),math.rad(50)),.1)
- LW.C0=Clerp(LW.C0,cf(-1.45,0.5 + 0.1 * math.cos(sine/25),0)*angles(math.rad(-20),math.rad(0),math.rad(-50)),.1)
- elseif torvel<1 and hitfloor~=nil then
- RH.C0=Clerp(RH.C0,cf(1,-1 - 0.05 * math.cos(sine / 28),0)*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(-2.5),math.rad(0),math.rad(0 + 1 * math.cos(sine / 34))),.1)
- LH.C0=Clerp(LH.C0,cf(-1,-1 - 0.05 * math.cos(sine / 28),0)*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(-2.5),math.rad(0),math.rad(0 + 1 * math.cos(sine / 34))),.1)
- RootJoint.C0=Clerp(RootJoint.C0,RootCF*cf(0,0,0 + 0.05 * math.cos(sine / 28))*angles(math.rad(0 - 1 * math.cos(sine / 34)),math.rad(0),math.rad(0)),.1)
- Torso.Neck.C0=Clerp(Torso.Neck.C0,necko*angles(math.rad(22.5 - 2.5 * math.cos(sine / 28)),math.rad(0),math.rad(0)),.1)
- RW.C0=Clerp(RW.C0,cf(1.5,0.5 + 0.1 * math.cos(sine / 28),0)*angles(math.rad(0),math.rad(0),math.rad(0)),.1)
- LW.C0=Clerp(LW.C0,cf(-1.5,0.5 + 0.1 * math.cos(sine / 28),0)*angles(math.rad(0),math.rad(0),math.rad(0)),.1)
- elseif torvel>2 and hitfloor~=nil then
- RH.C0=Clerp(RH.C0,cf(1,-0.85,-0.15 - 0.15 * math.cos(sine / 4))*angles(math.rad(0),math.rad(90),math.rad(0))*angles(math.rad(0),math.rad(0 + 5 * math.cos(sine / 8)),math.rad(0 + 25 * math.cos(sine / 8))),.1)
- LH.C0=Clerp(LH.C0,cf(-1,-0.85,-0.15 + 0.15 * math.cos(sine / 4))*angles(math.rad(0),math.rad(-90),math.rad(0))*angles(math.rad(0),math.rad(0 + 5 * math.cos(sine / 8)),math.rad(0 + 25 * math.cos(sine / 8))),.1)
- RootJoint.C0=Clerp(RootJoint.C0,RootCF*cf(0,0,-0.15 - 0.1 * math.cos(sine / 4))*angles(math.rad(5),math.rad(0),math.rad(0 - 5 * math.cos(sine / 8))),.1)
- Torso.Neck.C0=Clerp(Torso.Neck.C0,necko*angles(math.rad(10 + 2.5 * math.cos(sine / 100)),math.rad(0),math.rad(0 + 5 * math.cos(sine / 8))),.1)
- RW.C0=Clerp(RW.C0,cf(1.5,0.5,0)*angles(math.rad(0 - 10 * math.cos(sine / 8)),math.rad(0),math.rad(10 - 10 * math.cos(sine / 4))),.1)
- LW.C0=Clerp(LW.C0,cf(-1.5,0.5,0)*angles(math.rad(0 + 10 * math.cos(sine / 8)),math.rad(0),math.rad(-10 + 10 * math.cos(sine / 4))),.1)
- end
- end
- game:GetService("RunService").RenderStepped:Connect(function(delta)
- currentsine = currentsine + (25*delta)
- animation(currentsine)
- end)
- ]=],rolandscript)
- animationroland.Name = "Animate"
Add Comment
Please, Sign In to add comment