Advertisement
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)
- 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
- for _,p in pairs(conchar:GetDescendants())do
- if p:IsA("BasePart") then
- if p:GetNetworkOwner() ~= owner then
- p:SetNetworkOwner(owner)
- 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
- 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
- end
- elseif part:IsA("Humanoid") then
- part:Destroy()
- end
- end))
- end
- 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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement