Advertisement
plytalent

test kuroghost

Sep 23rd, 2021 (edited)
778
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. repeat wait() until #game:GetService("Players"):GetPlayers() > 0
  2. local coms = {Instance.new("RemoteEvent",script),Instance.new("RemoteFunction",script)}
  3. local owner = owner or game:GetService("Players"):WaitForChild("plytalent")
  4. local FF = Instance.new("ForceField",owner.Character)
  5. local waitremote = Instance.new('RemoteEvent',script)
  6.  
  7. function createFakeCharacter(DisplayName)
  8.     local Model0 = Instance.new("Model")
  9.     local Part1 = Instance.new("Part")
  10.     local SpecialMesh2 = Instance.new("SpecialMesh")
  11.     local Part3 = Instance.new("Part")
  12.     local Part4 = Instance.new("Part")
  13.     local Part5 = Instance.new("Part")
  14.     local Part6 = Instance.new("Part")
  15.     local Part7 = Instance.new("Part")
  16.     local Humanoid8 = Instance.new("Humanoid")
  17.     local Part9 = Instance.new("Part")
  18.     local CharacterMesh10 = Instance.new("CharacterMesh")
  19.     local Shirt11 = Instance.new("Shirt")
  20.     local Pants12 = Instance.new("Pants")
  21.     local Part13 = Instance.new("Part")
  22.     local SpecialMesh14 = Instance.new("SpecialMesh")
  23.     local AlignOrientation15 = Instance.new("AlignOrientation")
  24.     local AlignPosition16 = Instance.new("AlignPosition")
  25.     local Part17 = Instance.new("Part")
  26.     local SpecialMesh18 = Instance.new("SpecialMesh")
  27.     local AlignOrientation19 = Instance.new("AlignOrientation")
  28.     local AlignPosition20 = Instance.new("AlignPosition")
  29.     local Attachment21 = Instance.new("Attachment")
  30.     local Attachment22 = Instance.new("Attachment")
  31.     local Attachment23 = Instance.new("Attachment")
  32.  
  33.     Attachment21.Name = "Head"
  34.     Attachment22.Name = "Hair"
  35.     Attachment23.Name = "Mask"
  36.     Attachment21.Parent = Part1
  37.     Attachment22.Parent = Part17
  38.     Attachment23.Parent = Part13
  39.  
  40.     Model0.Name = "Ghost"
  41.     Model0.PrimaryPart = Part9
  42.     Part1.Name = "Head"
  43.     Part1.Parent = Model0
  44.     Part1.CFrame = CFrame.new(-51.5, 4.5, -53, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  45.     Part1.Position = Vector3.new(-51.5, 4.5, -53)
  46.     Part1.Color = Color3.new(0.972549, 0.972549, 0.972549)
  47.     Part1.Size = Vector3.new(2, 1, 1)
  48.     Part1.BrickColor = BrickColor.new("Institutional white")
  49.     Part1.Material = Enum.Material.Sand
  50.     Part1.TopSurface = Enum.SurfaceType.Smooth
  51.     Part1.brickColor = BrickColor.new("Institutional white")
  52.     Part1.FormFactor = Enum.FormFactor.Symmetric
  53.     Part1.formFactor = Enum.FormFactor.Symmetric
  54.     SpecialMesh2.Parent = Part1
  55.     SpecialMesh2.Scale = Vector3.new(1.25, 1.25, 1.25)
  56.     Part3.Name = "Torso"
  57.     Part3.Parent = Model0
  58.     Part3.CFrame = CFrame.new(-51.5, 3, -53, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  59.     Part3.Position = Vector3.new(-51.5, 3, -53)
  60.     Part3.Color = Color3.new(0.972549, 0.972549, 0.972549)
  61.     Part3.Size = Vector3.new(2, 2, 1)
  62.     Part3.BrickColor = BrickColor.new("Institutional white")
  63.     Part3.LeftParamA = 0
  64.     Part3.LeftParamB = 0
  65.     Part3.LeftSurface = Enum.SurfaceType.Weld
  66.     Part3.Material = Enum.Material.Sand
  67.     Part3.RightParamA = 0
  68.     Part3.RightParamB = 0
  69.     Part3.RightSurface = Enum.SurfaceType.Weld
  70.     Part3.brickColor = BrickColor.new("Institutional white")
  71.     Part3.FormFactor = Enum.FormFactor.Symmetric
  72.     Part3.formFactor = Enum.FormFactor.Symmetric
  73.     Part4.Name = "Left Arm"
  74.     Part4.Parent = Model0
  75.     Part4.CFrame = CFrame.new(-53, 3, -53, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  76.     Part4.Position = Vector3.new(-53, 3, -53)
  77.     Part4.Color = Color3.new(0.972549, 0.972549, 0.972549)
  78.     Part4.Size = Vector3.new(1, 2, 1)
  79.     Part4.BrickColor = BrickColor.new("Institutional white")
  80.     Part4.CanCollide = false
  81.     Part4.Material = Enum.Material.Sand
  82.     Part4.brickColor = BrickColor.new("Institutional white")
  83.     Part4.FormFactor = Enum.FormFactor.Symmetric
  84.     Part4.formFactor = Enum.FormFactor.Symmetric
  85.     Part5.Name = "Right Arm"
  86.     Part5.Parent = Model0
  87.     Part5.CFrame = CFrame.new(-50, 3, -53, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  88.     Part5.Position = Vector3.new(-50, 3, -53)
  89.     Part5.Color = Color3.new(0.972549, 0.972549, 0.972549)
  90.     Part5.Size = Vector3.new(1, 2, 1)
  91.     Part5.BrickColor = BrickColor.new("Institutional white")
  92.     Part5.CanCollide = false
  93.     Part5.Material = Enum.Material.Sand
  94.     Part5.brickColor = BrickColor.new("Institutional white")
  95.     Part5.FormFactor = Enum.FormFactor.Symmetric
  96.     Part5.formFactor = Enum.FormFactor.Symmetric
  97.     Part6.Name = "Left Leg"
  98.     Part6.Parent = Model0
  99.     Part6.CFrame = CFrame.new(-52, 1, -53, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  100.     Part6.Position = Vector3.new(-52, 1, -53)
  101.     Part6.Color = Color3.new(0.972549, 0.972549, 0.972549)
  102.     Part6.Size = Vector3.new(1, 2, 1)
  103.     Part6.BottomSurface = Enum.SurfaceType.Smooth
  104.     Part6.BrickColor = BrickColor.new("Institutional white")
  105.     Part6.CanCollide = false
  106.     Part6.Material = Enum.Material.Sand
  107.     Part6.brickColor = BrickColor.new("Institutional white")
  108.     Part6.FormFactor = Enum.FormFactor.Symmetric
  109.     Part6.formFactor = Enum.FormFactor.Symmetric
  110.     Part7.Name = "Right Leg"
  111.     Part7.Parent = Model0
  112.     Part7.CFrame = CFrame.new(-51, 1, -53, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  113.     Part7.Position = Vector3.new(-51, 1, -53)
  114.     Part7.Color = Color3.new(0.972549, 0.972549, 0.972549)
  115.     Part7.Size = Vector3.new(1, 2, 1)
  116.     Part7.BottomSurface = Enum.SurfaceType.Smooth
  117.     Part7.BrickColor = BrickColor.new("Institutional white")
  118.     Part7.CanCollide = false
  119.     Part7.Material = Enum.Material.Sand
  120.     Part7.brickColor = BrickColor.new("Institutional white")
  121.     Part7.FormFactor = Enum.FormFactor.Symmetric
  122.     Part7.formFactor = Enum.FormFactor.Symmetric
  123.     Humanoid8.Parent = Model0
  124.     Humanoid8.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
  125.     Humanoid8.HealthDisplayDistance = 0
  126.     Humanoid8.HealthDisplayType = Enum.HumanoidHealthDisplayType.AlwaysOff
  127.     Humanoid8.LeftLeg = Part6
  128.     Humanoid8.NameDisplayDistance = 0
  129.     Humanoid8.RightLeg = Part7
  130.     Humanoid8.Torso = Part9
  131.     Part9.Name = "HumanoidRootPart"
  132.     Part9.Parent = Model0
  133.     Part9.CFrame = CFrame.new(-51.5, 3, -53, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  134.     Part9.Position = Vector3.new(-51.5, 3, -53)
  135.     Part9.Transparency = 1
  136.     Part9.Size = Vector3.new(2, 2, 1)
  137.     Part9.Anchored = false
  138.     Part9.BottomSurface = Enum.SurfaceType.Smooth
  139.     Part9.CanCollide = false
  140.     Part9.LeftParamA = 0
  141.     Part9.LeftParamB = 0
  142.     Part9.Material = Enum.Material.Sand
  143.     Part9.RightParamA = 0
  144.     Part9.RightParamB = 0
  145.     Part9.TopSurface = Enum.SurfaceType.Smooth
  146.     Part9.FormFactor = Enum.FormFactor.Symmetric
  147.     Part9.formFactor = Enum.FormFactor.Symmetric
  148.     CharacterMesh10.Parent = Model0
  149.     CharacterMesh10.BodyPart = Enum.BodyPart.Torso
  150.     CharacterMesh10.MeshId = "rbxassetid://48112070"
  151.     Shirt11.Name = "Shirt"
  152.     Shirt11.Parent = Model0
  153.     Shirt11.ShirtTemplate = "http://www.roblox.com/asset/?id=1210857659"
  154.     Pants12.Name = "Pants"
  155.     Pants12.Parent = Model0
  156.     Pants12.PantsTemplate = "http://www.roblox.com/asset/?id=1210858273"
  157.     Part13.Name = "Mask"
  158.     Part13.Parent = Model0
  159.     Part13.CFrame = CFrame.new(-51.5017433, 4.50454998, -53.0024185, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  160.     Part13.Position = Vector3.new(-51.50174331665, 4.5045499801636, -53.002418518066)
  161.     Part13.Size = Vector3.new(2, 1, 1)
  162.     Part13.BottomSurface = Enum.SurfaceType.Smooth
  163.     Part13.CanCollide = false
  164.     Part13.Material = Enum.Material.Sand
  165.     Part13.TopSurface = Enum.SurfaceType.Smooth
  166.     SpecialMesh14.Name = "SpecialMesh"
  167.     SpecialMesh14.Parent = Part13
  168.     SpecialMesh14.MeshId = "rbxassetid://5728632913"
  169.     SpecialMesh14.TextureId = "http://www.roblox.com/asset/?id=4809181158"
  170.     SpecialMesh14.MeshType = Enum.MeshType.FileMesh
  171.     AlignOrientation15.Parent = Part13
  172.     AlignOrientation15.Attachment0 = Attachment22
  173.     AlignOrientation15.Attachment1 = Attachment21
  174.     AlignOrientation15.RigidityEnabled = true
  175.     AlignPosition16.Parent = Part13
  176.     AlignPosition16.Attachment0 = Attachment22
  177.     AlignPosition16.Attachment1 = Attachment21
  178.     AlignPosition16.RigidityEnabled = true
  179.     Part17.Name = "Hair"
  180.     Part17.Parent = Model0
  181.     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)
  182.     Part17.Orientation = Vector3.new(-1.6399999856949, 0, 0)
  183.     Part17.Position = Vector3.new(-51.5, 4.5, -53)
  184.     Part17.Rotation = Vector3.new(-1.6399999856949, 0, 0)
  185.     Part17.Size = Vector3.new(2, 1, 1)
  186.     Part17.BottomSurface = Enum.SurfaceType.Smooth
  187.     Part17.CanCollide = false
  188.     Part17.Material = Enum.Material.Sand
  189.     Part17.TopSurface = Enum.SurfaceType.Smooth
  190.     SpecialMesh18.Name = "SpecialMesh"
  191.     SpecialMesh18.Parent = Part17
  192.     SpecialMesh18.MeshId = "rbxassetid://6521980205"
  193.     SpecialMesh18.Offset = Vector3.new(0, -0.80000001192093, 0.20000000298023)
  194.     SpecialMesh18.Scale = Vector3.new(0.94999998807907, 0.95999997854233, 0.91000002622604)
  195.     SpecialMesh18.TextureId = "http://www.roblox.com/asset/?id=6517665515"
  196.     SpecialMesh18.MeshType = Enum.MeshType.FileMesh
  197.     AlignOrientation19.Parent = Part17
  198.     AlignOrientation19.Attachment0 = Attachment23
  199.     AlignOrientation19.Attachment1 = Attachment21
  200.     AlignOrientation19.RigidityEnabled = true
  201.     AlignPosition20.Parent = Part17
  202.     AlignPosition20.Attachment0 = Attachment23
  203.     AlignPosition20.Attachment1 = Attachment21
  204.     AlignPosition20.RigidityEnabled = true
  205.  
  206.     return Model0
  207. end
  208.  
  209. local mainchar = createFakeCharacter(owner.DisplayName)
  210. local conchar = mainchar:Clone()
  211.  
  212. FF.Visible = false
  213.  
  214. local comsfuncs={
  215.     function(plr, partname, partposition, partsize, partorientation)
  216.         if plr ~= owner then
  217.             return
  218.         end
  219.         if owner.Character.Parent then
  220.             owner.Character.Parent = nil
  221.         end
  222.         if not conchar then
  223.             conchar = mainchar:Clone()
  224.             conchar.Parent = workspace
  225.             return
  226.         end
  227.         if not conchar.Parent then
  228.             conchar=nil
  229.             return
  230.         end
  231.         if FF.Parent ~= owner.Character then
  232.             FF = Instance.new("ForceField",owner.Character)
  233.             FF.Visible = false
  234.         end
  235.         conchar.Name = "Ghost"
  236.         local part = conchar:FindFirstChild(partname)
  237.         if not part then
  238.             conchar:Destroy()
  239.             conchar = nil
  240.             return
  241.         end
  242.         for _,p in pairs(conchar:GetDescendants())do
  243.             if p:IsA("BasePart") then
  244.                 if p:GetNetworkOwner() ~= owner then
  245.                     p:SetNetworkOwner(owner)
  246.                 end
  247.             end
  248.         end
  249.         if part then
  250.             if not part:FindFirstChild("PartAlignPos") then
  251.                 part.Position = partposition
  252.                 local AlignPosition = Instance.new("AlignPosition",part)
  253.                 local AlignOrientation = Instance.new("AlignOrientation",part)
  254.                 AlignPosition.Name = "PartAlignPos"
  255.                 AlignOrientation.Name = "PartAlignOri"
  256.                 local attachment0 = Instance.new("Attachment",part)
  257.                 local attachment1 = Instance.new("Attachment",part)
  258.                 attachment1.Name = "attachment1"
  259.                 AlignOrientation.RigidityEnabled = true
  260.                 AlignPosition.RigidityEnabled = true
  261.                 AlignOrientation.Attachment0 = attachment0
  262.                 AlignOrientation.Attachment1 = attachment1
  263.                 AlignPosition.Attachment0 = attachment0
  264.                 AlignPosition.Attachment1 = attachment1
  265.             end
  266.             if partname == "HumanoidRootPart" then
  267.                 part.Transparency = 1
  268.             else
  269.                 part.Transparency = 0.5
  270.             end
  271.             part.Name = partname
  272.             if part:GetNetworkOwner() ~= owner then
  273.                 part:SetNetworkOwner(owner)
  274.             end
  275.         end
  276.     end,
  277.     function(plr)
  278.         if plr ~= owner then
  279.             return
  280.         end
  281.         return conchar
  282.     end
  283. }
  284. coms[1].Name = "Com1"
  285. coms[2].Name = "Com2"
  286. waitremote.Name = "WaitRemote"
  287. coms[2].OnServerInvoke = comsfuncs[2]
  288. coms[1].OnServerEvent:Connect(comsfuncs[1])
  289.  
  290. NLS([==[
  291.     local remote=script.Parent.Com1
  292. local com1 = script.Parent.Com2
  293. local owner = owner or game:GetService("Players").LocalPlayer
  294. game:GetService("RunService").RenderStepped:Connect(function()
  295.     if owner.Character.Parent ~= workspace then
  296.         owner.Character.Parent = workspace
  297.     end
  298. end)
  299. local parttable={}
  300. local FF
  301. game:GetService("RunService").Stepped:Connect(function()
  302.     if not FF then
  303.         FF = Instance.new("ForceField")
  304.     end
  305.     if not FF.Parent  then
  306.         FF = nil
  307.     end
  308.     if FF then
  309.         FF.Visible = false
  310.     end
  311.     for _, part in pairs(owner.Character:GetChildren()) do
  312.         coroutine.resume(coroutine.create(function()
  313.             local part = part
  314.             if part:IsA("BasePart") then
  315.                 remote:FireServer(part.Name, part.Position, part.Size, part.Orientation)
  316.             end
  317.         end))
  318.     end
  319. end)
  320.  
  321. game:GetService("RunService").RenderStepped:Connect(function()
  322.     if com1:InvokeServer() then
  323.         for _,part in pairs(com1:InvokeServer():GetDescendants()) do
  324.             coroutine.resume(coroutine.create(function()
  325.                 if part:IsA("BasePart") then
  326.                     part.CanCollide = false
  327.                     if part:FindFirstChild("attachment1") then
  328.                         part.attachment1.Parent = owner.Character[part.Name]
  329.                         part.Position = owner.Character[part.Name].Position
  330.                     end
  331.                 elseif part:IsA("Humanoid") then
  332.                     part:Destroy()
  333.                 end
  334.             end))
  335.         end
  336.     end
  337. end)
  338.  
  339. script.Parent.WaitRemote:FireServer()
  340. ]==],script)
  341.  
  342. game:GetService("RunService").Heartbeat:Connect(function()
  343.     for i=1,#coms do
  344.         if not coms[i].Parent then
  345.             local ClassName = coms[i].ClassName
  346.             coms[i] = Instance.new(ClassName,script)
  347.             if ClassName == "RemoteEvent" then
  348.                 coms[i].OnServerEvent:Connect(comsfuncs[i])
  349.             elseif ClassName == "RemoteFunction" then
  350.                 coms[i].OnServerInvoke = comsfuncs[i]
  351.             end
  352.         end
  353.         if coms[i].Name ~= "Com" .. tostring(i) then
  354.             coms[i].Name = "Com" .. tostring(i)
  355.         end
  356.     end
  357. end)
  358. script.Parent = owner.PlayerGui
  359. print("waiting")
  360. waitremote.OnServerEvent:Wait()
  361. print("Destroy! wait remote")
  362. waitremote:Destroy()
  363. owner.Character.Parent = nil
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement