plytalent

ghost

May 10th, 2021 (edited)
564
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.51 KB | None | 0 0
  1. repeat wait() until #game:GetService("Players"):GetPlayers() > 0
  2. owner = game.Players.plytalent
  3. local com0 = Instance.new("RemoteEvent",script)
  4. local waitremote = Instance.new('RemoteEvent',script)
  5. waitremote.Name = "WaitRemote"
  6. -------- RAINBOW LEAVE IT TO ME
  7. local r = 255
  8. local g = 0
  9. local b = 0
  10. coroutine.resume(coroutine.create(function()
  11.     while true do
  12.         for i = 1, 255/5 do
  13.             game:GetService("RunService").Stepped:Wait()
  14.             g = g + 5
  15.         end
  16.         for i = 1, 255/5 do
  17.             game:GetService("RunService").Stepped:Wait()
  18.             r = r - 5
  19.         end
  20.         for i = 1, 255/5 do
  21.             game:GetService("RunService").Stepped:Wait()
  22.             b = b + 5
  23.         end
  24.         for i = 1, 255/5 do
  25.             game:GetService("RunService").Stepped:Wait()
  26.             g = g - 5
  27.         end
  28.         for i = 1, 255/5 do
  29.             game:GetService("RunService").Stepped:Wait()
  30.             r = r + 5
  31.         end
  32.         for i = 1, 255/5 do
  33.             game:GetService("RunService").Stepped:Wait()
  34.             b = b - 5
  35.         end
  36.     end
  37. end))
  38. com0.OnServerEvent:Connect(function(plr,partname,partcf,partsize)
  39.     if plr ~= owner then
  40.         return
  41.     end
  42.     if not charst then
  43.         return
  44.     end
  45.     if not conchar then
  46.         conchar = Instance.new("Model")
  47.         hum = Instance.new("Humanoid",charst)
  48.         hum.MaxHealth = 1
  49.         return
  50.     end
  51.     if not conchar.Parent then
  52.         conchar=nil
  53.         return
  54.     end
  55.     conchar.Name = "Ghost"
  56.     local part = conchar:FindFirstChild(partname)
  57.     if not part then
  58.         pcall(function()
  59.             part = Instance.new("Part",conchar)
  60.             part.Size = partsize + Vector3.new(0.05, 0.05, 0.05)
  61.             part.Material = Enum.Material.ForceField
  62.             if partname == "Head" then
  63.                 local headmesh = Instance.new("SpecialMesh",part)
  64.                 headmesh.Scale = Vector3.new(1.25,1.25,1.25)
  65.                 headmesh.MeshType = Enum.MeshType.Head
  66.             end
  67.         end)
  68.     end
  69.     if part then
  70.         if partname == "HumanoidRootPart" then
  71.             part.Transparency = 1
  72.         end
  73.         part.Name = partname
  74.         part.Anchored = true
  75.         part.CFrame = partcf
  76.         part.Color = Color3.new(r/255, g/255, b/255)
  77.     end
  78. end)
  79. local NLS = NLS or nil
  80. wait(3)
  81. if NLS then
  82.     NLS([==[
  83.     local remote=script.Parent.RemoteEvent
  84. game:GetService("RunService").RenderStepped:Connect(function()
  85.     if game:GetService("Players").LocalPlayer.Character.Parent ~= workspace then
  86.         game:GetService("Players").LocalPlayer.Character.Parent = workspace
  87.     end
  88. end)
  89. local parttable={}
  90. wait()
  91. game:GetService("RunService").Stepped:Connect(function()
  92.     coroutine.resume(coroutine.create(function()
  93.         if workspace:FindFirstChild("Ghost") then
  94.             for _,part in pairs(workspace:FindFirstChild("Ghost"):GetDescendants()) do
  95.                 if part:IsA("BasePart") then
  96.                     part.CanCollide = false
  97.                     part.Velocity = Vector3.new(0,0,0)
  98.                 elseif part:IsA("Humanoid") then
  99.                     part:Destroy()
  100.                 end
  101.             end
  102.         end
  103.     end))
  104.     for _, part in pairs(game:GetService("Players").LocalPlayer.Character:GetChildren()) do
  105.         coroutine.resume(coroutine.create(function()
  106.             local part = part
  107.             if part:IsA("BasePart") then
  108.                 if parttable[part.Name] ~= part.CFrame then
  109.                     parttable[part.Name] = part.CFrame
  110.                     remote:FireServer(part.Name,part.CFrame,part.Size)
  111.                 end
  112.             end
  113.         end))
  114.     end
  115. end)
  116.  
  117. script.Parent.WaitRemote:FireServer()
  118.  
  119. ]==],script)
  120. elseif script:FindFirstChild("LocalScript") then
  121.     script.LocalScript.Disabled = false
  122. end
  123. script.Parent = owner.PlayerGui
  124. print("waiting")
  125. waitremote.OnServerEvent:Wait()
  126. print("Destroy! wait remote")
  127. waitremote:Destroy()
  128. charst = Instance.new("Model")
  129. hum = Instance.new("Humanoid",charst)
  130. hum.MaxHealth = 1
  131. charst.Name = "Ghost"
  132. owner.Character.Parent = nil
  133. conchar = charst:Clone()
  134. conchar.Parent = workspace
  135.  
Add Comment
Please, Sign In to add comment