zombieslayerwtf

how did i found this

Jan 24th, 2020
523
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --By Rufus14
  2. players = game:GetService("Players")
  3. runservice = game:GetService("RunService")
  4. --owner = players:GetPlayerFromCharacter(script.Parent)
  5. plrgui = owner:findFirstChildOfClass("PlayerGui")
  6. character = owner.Character
  7. NLS([[players = game:GetService("Players")
  8. runservice = game:GetService("RunService")
  9. localplayer = players.LocalPlayer
  10. plrgui = localplayer:findFirstChildOfClass("PlayerGui")
  11. character = localplayer.Character
  12. remote = character:WaitForChild("funkyremotedoe")
  13. gui = plrgui:WaitForChild("ohshitagh0st")
  14. ghostframe = gui:WaitForChild("gh0stframe")
  15. ghostbutton = ghostframe:WaitForChild("gh0stbutton")
  16. visibleframe = gui:WaitForChild("visibleframe")
  17. visiblebutton = visibleframe:WaitForChild("visiblebutton")
  18. modeframe = gui:WaitForChild("modeframe")
  19. modebutton = modeframe:WaitForChild("modebutton")
  20. ghosted = false
  21. visible = true
  22. bodytype = "Ghost"
  23. function mufflesound(what)
  24.     local eq = Instance.new("EqualizerSoundEffect", what)
  25.     eq.HighGain = -30
  26.     eq.MidGain = -30
  27.     eq.LowGain = 0
  28.     eq.Name = "GhostMuffleSound"
  29. end
  30. function unmufflesound(what)
  31.     if what:findFirstChild("GhostMuffleSound") then
  32.         what.GhostMuffleSound:destroy()
  33.     end
  34. end
  35. workspace.DescendantAdded:connect(function(what)
  36.     if what.ClassName == "Sound" then
  37.         if ghosted then
  38.             mufflesound(what)
  39.         end
  40.     end
  41. end)
  42. modebutton.MouseButton1Click:connect(function()
  43.     if bodytype == "Ghost" then
  44.         modebutton.Active = false
  45.         remote:FireServer("humanoidbody", character.Head.CFrame)
  46.     elseif bodytype == "Humanoid" then
  47.         modebutton.Active = false
  48.         remote:FireServer("ghostbody", character.Head.CFrame)
  49.     end
  50. end)
  51. ghostbutton.MouseButton1Click:connect(function()
  52.     if not ghosted then
  53.         ghostbutton.Active = false
  54.         remote:FireServer("ghostmeplease")
  55.     else
  56.         ghostbutton.Active = false
  57.         remote:FireServer("unghostmeplease", character.Head.CFrame)
  58.     end
  59. end)
  60. visiblebutton.MouseButton1Click:connect(function()
  61.     if not visible then
  62.         visiblebutton.Active = false
  63.         remote:FireServer("visiblemepls", character.Head.CFrame)
  64.     else
  65.         visiblebutton.Active = false
  66.         remote:FireServer("invisiblemepls", character.Head.CFrame)
  67.     end
  68. end)
  69. remote.OnClientEvent:connect(function(WHAT)
  70.     if WHAT == "ghostlocal" then
  71.         ghosted = true
  72.         ghostbutton.Text = "Ghost: On"
  73.         ghostbutton.Active = true
  74.         character.Parent = workspace
  75.         workspace.CurrentCamera.FieldOfView = workspace.CurrentCamera.FieldOfView + 10
  76.         local correct = Instance.new("ColorCorrectionEffect", workspace.CurrentCamera)
  77.         correct.TintColor = Color3.fromRGB(255, 200, 255)
  78.         correct.Name = "ghosteffect"
  79.         for i,v in pairs(workspace:GetDescendants()) do
  80.             if v.ClassName == "Sound" then
  81.                 mufflesound(v)
  82.             end
  83.         end
  84.         for i = 1,20 do
  85.             workspace.CurrentCamera.FieldOfView = workspace.CurrentCamera.FieldOfView - 0.5
  86.             runservice.RenderStepped:wait()
  87.         end
  88.     elseif WHAT == "unghostlocal" then
  89.         ghosted = false
  90.         ghostbutton.Text = "Ghost: Off"
  91.         ghostbutton.Active = true
  92.         if workspace.CurrentCamera:findFirstChild("ghosteffect") then
  93.             workspace.CurrentCamera.ghosteffect:destroy()
  94.         end
  95.         workspace.CurrentCamera.FieldOfView = workspace.CurrentCamera.FieldOfView + 10
  96.         for i,v in pairs(workspace:GetDescendants()) do
  97.             if v.ClassName == "Sound" then
  98.                 unmufflesound(v)
  99.             end
  100.         end
  101.         for i = 1,20 do
  102.             workspace.CurrentCamera.FieldOfView = workspace.CurrentCamera.FieldOfView - 0.5
  103.             runservice.RenderStepped:wait()
  104.         end
  105.     elseif WHAT == "invisiblelocal" then
  106.         visible = false
  107.         visiblebutton.Text = "Visible: Off"
  108.         visiblebutton.Active = true
  109.     elseif WHAT == "visiblelocal" then
  110.         visible = true
  111.         visiblebutton.Text = "Visible: On"
  112.         visiblebutton.Active = true
  113.     elseif WHAT == "ghostedbody" then
  114.         bodytype = "Ghost"
  115.         modebutton.Text = "Body Type: Ghost"
  116.         modebutton.Active = true
  117.     elseif WHAT == "humanoidedbody" then
  118.         bodytype = "Humanoid"
  119.         modebutton.Text = "Body Type: Humanoid"
  120.         modebutton.Active = true
  121.     end
  122. end)
  123. coroutine.wrap(function()
  124.     while runservice.Stepped:wait() do
  125.         if workspace:findFirstChild("GH0ST ("..string.lower(localplayer.Name)..")") then
  126.             local themodel = workspace:findFirstChild("GH0ST ("..string.lower(localplayer.Name)..")")
  127.             if themodel:findFirstChildOfClass("Humanoid") then
  128.                 for i,v in pairs(themodel:GetDescendants()) do
  129.                     if v.ClassName == "SpawnLocation" then
  130.                         v.CanCollide = false
  131.                     end
  132.                 end
  133.             end
  134.         end
  135.     end
  136. end)()
  137. while runservice.RenderStepped:wait() do
  138.     if workspace:findFirstChild("GH0ST ("..string.lower(localplayer.Name)..")") then
  139.         local themodel = workspace:findFirstChild("GH0ST ("..string.lower(localplayer.Name)..")")
  140.         for i,v in pairs(character:GetDescendants()) do
  141.             for q,w in pairs(themodel:GetDescendants()) do
  142.                 if w.Name == v.Name then
  143.                     if w.ClassName == "SpawnLocation" and w.Parent.ClassName ~= "Accessory" and w.Parent.ClassName ~= "Hat" then
  144.                         w.CFrame = v.CFrame
  145.                         w.Velocity = Vector3.new()
  146.                         w.RotVelocity = Vector3.new()
  147.                     end
  148.                 end
  149.             end
  150.         end
  151.         for i,v in pairs(character:GetChildren()) do
  152.             for q,w in pairs(themodel:GetChildren()) do
  153.                 if w.Name == v.Name then
  154.                     if w.ClassName == "Accessory" or w.ClassName == "Hat" then
  155.                         if w:findFirstChild("Handle") and v:findFirstChild("Handle") then
  156.                             w.Handle.CFrame = v.Handle.CFrame
  157.                             w.Handle.Velocity = Vector3.new()
  158.                             w.Handle.RotVelocity = Vector3.new()
  159.                         end
  160.                     end
  161.                 end
  162.             end
  163.         end
  164.     end
  165. end]], character)
  166. visible = true
  167. ghosted = false
  168. bodytype = "Ghost"
  169. local remote = Instance.new("RemoteEvent", character)
  170. remote.Name = "funkyremotedoe"
  171. --Converted with ttyyuu12345's model to script plugin v4
  172. function sandbox(var,func)
  173.     local env = getfenv(func)
  174.     local newenv = setmetatable({},{
  175.         __index = function(self,k)
  176.             if k=="script" then
  177.                 return var
  178.             else
  179.                 return env[k]
  180.             end
  181.         end,
  182.     })
  183.     setfenv(func,newenv)
  184.     return func
  185. end
  186. cors = {}
  187. mas = Instance.new("Model",game:GetService("Lighting"))
  188. ScreenGui0 = Instance.new("ScreenGui")
  189. Frame1 = Instance.new("Frame")
  190. ghostbutton = Instance.new("TextButton")
  191. Frame3 = Instance.new("Frame")
  192. visiblebutton = Instance.new("TextButton")
  193. Frame5 = Instance.new("Frame")
  194. modebutton = Instance.new("TextButton")
  195. ScreenGui0.Name = "ohshitagh0st"
  196. ScreenGui0.Parent = mas
  197. ScreenGui0.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  198. Frame1.Name = "gh0stframe"
  199. Frame1.Parent = ScreenGui0
  200. Frame1.Position = UDim2.new(0.816999972, 0, 0.950999975, 0)
  201. Frame1.Size = UDim2.new(0, 234, 0, 35)
  202. Frame1.BackgroundColor = BrickColor.new("Institutional white")
  203. Frame1.BackgroundColor3 = Color3.new(1, 1, 1)
  204. Frame1.Style = Enum.FrameStyle.RobloxRound
  205. ghostbutton.Name = "gh0stbutton"
  206. ghostbutton.Parent = Frame1
  207. ghostbutton.Position = UDim2.new(0.0164168887, 0, -0.225141287, 0)
  208. ghostbutton.Size = UDim2.new(0, 210, 0, 29)
  209. ghostbutton.BackgroundColor = BrickColor.new("Institutional white")
  210. ghostbutton.BackgroundColor3 = Color3.new(1, 1, 1)
  211. ghostbutton.Style = Enum.ButtonStyle.RobloxButtonDefault
  212. ghostbutton.Font = Enum.Font.SourceSans
  213. ghostbutton.FontSize = Enum.FontSize.Size14
  214. ghostbutton.Text = "Ghost: Off"
  215. ghostbutton.TextColor = BrickColor.new("Institutional white")
  216. ghostbutton.TextColor3 = Color3.new(1, 1, 1)
  217. ghostbutton.TextScaled = true
  218. ghostbutton.TextSize = 14
  219. ghostbutton.TextWrap = true
  220. ghostbutton.TextWrapped = true
  221. Frame3.Name = "visibleframe"
  222. Frame3.Parent = ScreenGui0
  223. Frame3.Position = UDim2.new(0.816999972, 0, 0.902999997, 0)
  224. Frame3.Size = UDim2.new(0, 234, 0, 35)
  225. Frame3.BackgroundColor = BrickColor.new("Institutional white")
  226. Frame3.BackgroundColor3 = Color3.new(1, 1, 1)
  227. Frame3.Style = Enum.FrameStyle.RobloxRound
  228. visiblebutton.Name = "visiblebutton"
  229. visiblebutton.Parent = Frame3
  230. visiblebutton.Position = UDim2.new(0.0164168887, 0, -0.225141287, 0)
  231. visiblebutton.Size = UDim2.new(0, 210, 0, 29)
  232. visiblebutton.BackgroundColor = BrickColor.new("Institutional white")
  233. visiblebutton.BackgroundColor3 = Color3.new(1, 1, 1)
  234. visiblebutton.Style = Enum.ButtonStyle.RobloxButtonDefault
  235. visiblebutton.Font = Enum.Font.SourceSans
  236. visiblebutton.FontSize = Enum.FontSize.Size14
  237. visiblebutton.Text = "Visible: On"
  238. visiblebutton.TextColor = BrickColor.new("Institutional white")
  239. visiblebutton.TextColor3 = Color3.new(1, 1, 1)
  240. visiblebutton.TextScaled = true
  241. visiblebutton.TextSize = 14
  242. visiblebutton.TextWrap = true
  243. visiblebutton.TextWrapped = true
  244. Frame5.Name = "modeframe"
  245. Frame5.Parent = ScreenGui0
  246. Frame5.Position = UDim2.new(0.816999972, 0, 0.853999972, 0)
  247. Frame5.Size = UDim2.new(0, 234, 0, 35)
  248. Frame5.BackgroundColor = BrickColor.new("Institutional white")
  249. Frame5.BackgroundColor3 = Color3.new(1, 1, 1)
  250. Frame5.Style = Enum.FrameStyle.RobloxRound
  251. modebutton.Name = "modebutton"
  252. modebutton.Parent = Frame5
  253. modebutton.Position = UDim2.new(0.0164168887, 0, -0.225141287, 0)
  254. modebutton.Size = UDim2.new(0, 210, 0, 29)
  255. modebutton.BackgroundColor = BrickColor.new("Institutional white")
  256. modebutton.BackgroundColor3 = Color3.new(1, 1, 1)
  257. modebutton.Style = Enum.ButtonStyle.RobloxButtonDefault
  258. modebutton.Font = Enum.Font.SourceSans
  259. modebutton.FontSize = Enum.FontSize.Size14
  260. modebutton.Text = "Body Type: Ghost"
  261. modebutton.TextColor = BrickColor.new("Institutional white")
  262. modebutton.TextColor3 = Color3.new(1, 1, 1)
  263. modebutton.TextScaled = true
  264. modebutton.TextSize = 14
  265. modebutton.TextWrap = true
  266. modebutton.TextWrapped = true
  267. for i,v in pairs(mas:GetChildren()) do
  268.     v.Parent = plrgui
  269.     pcall(function() v:MakeJoints() end)
  270. end
  271. mas:Destroy()
  272. for i,v in pairs(cors) do
  273.     spawn(function()
  274.         pcall(v)
  275.     end)
  276. end
  277. remote.OnServerEvent:connect(function(WHO, WHAT, VALUE)
  278.     if WHO == owner then
  279.         if WHAT == "ghostmeplease" then
  280.             ghosted = true
  281.             local sphereeffect = Instance.new("Part", workspace)
  282.             sphereeffect.Material = "Neon"
  283.             sphereeffect.Shape = "Ball"
  284.             sphereeffect.Anchored = true
  285.             sphereeffect.Name = "GhostTransitionEffect"
  286.             sphereeffect.CanCollide = false
  287.             sphereeffect.CFrame = character.Head.CFrame * CFrame.new(0,-1.5,0)
  288.             sphereeffect.Size = Vector3.new(10,10,10)
  289.             game.Debris:AddItem(sphereeffect, 3.8)
  290.             coroutine.wrap(function()
  291.                 local sound = Instance.new("Sound", sphereeffect)
  292.                 sound.SoundId = "rbxassetid://182981587"
  293.                 sound.Volume = 1
  294.                 sound.PlaybackSpeed = 0.5
  295.                 sound:Play()
  296.                 game.Debris:AddItem(sound, 3.8)
  297.             end)()
  298.             coroutine.wrap(function()
  299.                 for i = 1,20 do
  300.                     sphereeffect.Transparency = sphereeffect.Transparency + 0.05
  301.                     sphereeffect.Size = sphereeffect.Size - Vector3.new(0.5,0.5,0.5)
  302.                     runservice.Stepped:wait()
  303.                 end
  304.             end)()
  305.             local invisff = Instance.new("ForceField", character)
  306.             invisff.Visible = false
  307.             invisff.Name = "AntiExplosionFF"
  308.             character.Parent = ScreenGui0
  309.             remote:FireClient(owner, "ghostlocal")
  310.         elseif WHAT == "unghostmeplease" then
  311.             ghosted = false
  312.             if character:findFirstChild("AntiExplosionFF") then
  313.                 character.AntiExplosionFF:destroy()
  314.             end
  315.             local sphereeffect = Instance.new("Part", workspace)
  316.             sphereeffect.Material = "Neon"
  317.             sphereeffect.Shape = "Ball"
  318.             sphereeffect.Anchored = true
  319.             sphereeffect.CanCollide = false
  320.             sphereeffect.CFrame = VALUE * CFrame.new(0,-1.5,0)
  321.             sphereeffect.Size = Vector3.new(6,6,6)
  322.             game.Debris:AddItem(sphereeffect, 4)
  323.             coroutine.wrap(function()
  324.                 local sound = Instance.new("Sound", sphereeffect)
  325.                 sound.SoundId = "rbxassetid://171399373"
  326.                 sound.Volume = 1
  327.                 sound.PlaybackSpeed = 0.8
  328.                 sound:Play()
  329.                 game.Debris:AddItem(sound, 4)
  330.             end)()
  331.             coroutine.wrap(function()
  332.                 for i = 1,20 do
  333.                     sphereeffect.Transparency = sphereeffect.Transparency + 0.05
  334.                     sphereeffect.Size = sphereeffect.Size + Vector3.new(0.3,0.3,0.3)
  335.                     runservice.Stepped:wait()
  336.                 end
  337.             end)()
  338.             remote:FireClient(owner, "unghostlocal")
  339.             character.Parent = workspace
  340.         elseif WHAT == "invisiblemepls" then
  341.             visible = false
  342.             if workspace:findFirstChild("GH0ST ("..string.lower(owner.Name)..")") then
  343.                 workspace:findFirstChild("GH0ST ("..string.lower(owner.Name)..")"):destroy()
  344.             end
  345.             local sphereeffect = Instance.new("Part", workspace)
  346.             sphereeffect.Material = "ForceField"
  347.             sphereeffect.Shape = "Ball"
  348.             sphereeffect.Anchored = true
  349.             sphereeffect.Name = "GhostVisibilityEffect"
  350.             sphereeffect.CanCollide = false
  351.             sphereeffect.CFrame = VALUE * CFrame.new(0,-1.5,0)
  352.             sphereeffect.Size = Vector3.new(10,10,10)
  353.             coroutine.wrap(function()
  354.                 for i = 1,20 do
  355.                     sphereeffect.Transparency = sphereeffect.Transparency + 0.05
  356.                     sphereeffect.Size = sphereeffect.Size - Vector3.new(0.5,0.5,0.5)
  357.                     runservice.Stepped:wait()
  358.                 end
  359.                 sphereeffect:destroy()
  360.             end)()
  361.             remote:FireClient(owner, "invisiblelocal")
  362.         elseif WHAT == "visiblemepls" then
  363.             visible = true
  364.             local sphereeffect = Instance.new("Part", workspace)
  365.             sphereeffect.Material = "ForceField"
  366.             sphereeffect.Shape = "Ball"
  367.             sphereeffect.Anchored = true
  368.             sphereeffect.Name = "GhostVisibilityEffect"
  369.             sphereeffect.CanCollide = false
  370.             sphereeffect.CFrame = VALUE * CFrame.new(0,-1.5,0)
  371.             sphereeffect.Size = Vector3.new(1,1,1)
  372.             coroutine.wrap(function()
  373.                 for i = 1,20 do
  374.                     sphereeffect.Transparency = sphereeffect.Transparency + 0.05
  375.                     sphereeffect.Size = sphereeffect.Size + Vector3.new(0.5,0.5,0.5)
  376.                     runservice.Stepped:wait()
  377.                 end
  378.                 sphereeffect:destroy()
  379.             end)()
  380.             remote:FireClient(owner, "visiblelocal")
  381.         elseif WHAT == "humanoidbody" then
  382.             bodytype = "Humanoid"
  383.             if workspace:findFirstChild("GH0ST ("..string.lower(owner.Name)..")") then
  384.                 workspace:findFirstChild("GH0ST ("..string.lower(owner.Name)..")"):destroy()
  385.             end
  386.             local sphereeffect = Instance.new("Part", workspace)
  387.             sphereeffect.Material = "Neon"
  388.             sphereeffect.Shape = "Ball"
  389.             sphereeffect.BrickColor = BrickColor.Black()
  390.             sphereeffect.Anchored = true
  391.             sphereeffect.Name = "GhostModeEffect"
  392.             sphereeffect.CanCollide = false
  393.             sphereeffect.CFrame = VALUE * CFrame.new(0,-1.5,0)
  394.             sphereeffect.Size = Vector3.new(10,10,10)
  395.             coroutine.wrap(function()
  396.                 local sound = Instance.new("Sound", sphereeffect)
  397.                 sound.SoundId = "rbxassetid://34320976"
  398.                 sound.Volume = 1
  399.                 sound:Play()
  400.             end)()
  401.             coroutine.wrap(function()
  402.                 for i = 1,20 do
  403.                     sphereeffect.Transparency = sphereeffect.Transparency + 0.05
  404.                     sphereeffect.Size = sphereeffect.Size - Vector3.new(0.5,0.5,0.5)
  405.                     runservice.Stepped:wait()
  406.                 end
  407.                 wait(1.5)
  408.                 sphereeffect:destroy()
  409.             end)()
  410.             remote:FireClient(owner, "humanoidedbody")
  411.         elseif WHAT == "ghostbody" then
  412.             bodytype = "Ghost"
  413.             if workspace:findFirstChild("GH0ST ("..string.lower(owner.Name)..")") then
  414.                 workspace:findFirstChild("GH0ST ("..string.lower(owner.Name)..")"):destroy()
  415.             end
  416.             local sphereeffect = Instance.new("Part", workspace)
  417.             sphereeffect.Material = "Neon"
  418.             sphereeffect.Shape = "Ball"
  419.             sphereeffect.BrickColor = BrickColor.Black()
  420.             sphereeffect.Anchored = true
  421.             sphereeffect.Name = "GhostModeEffect"
  422.             sphereeffect.CanCollide = false
  423.             sphereeffect.CFrame = VALUE * CFrame.new(0,-1.5,0)
  424.             sphereeffect.Size = Vector3.new(10,10,10)
  425.             coroutine.wrap(function()
  426.                 local sound = Instance.new("Sound", sphereeffect)
  427.                 sound.SoundId = "rbxassetid://34320976"
  428.                 sound.Volume = 1
  429.                 sound:Play()
  430.             end)()
  431.             coroutine.wrap(function()
  432.                 for i = 1,20 do
  433.                     sphereeffect.Transparency = sphereeffect.Transparency + 0.05
  434.                     sphereeffect.Size = sphereeffect.Size - Vector3.new(0.5,0.5,0.5)
  435.                     runservice.Stepped:wait()
  436.                 end
  437.                 wait(1.5)
  438.                 sphereeffect:destroy()
  439.             end)()
  440.             remote:FireClient(owner, "ghostedbody")
  441.         end
  442.     end
  443. end)
  444. while wait() do
  445.     if ghosted then
  446.         if visible then
  447.             if not workspace:findFirstChild("GH0ST ("..string.lower(owner.Name)..")") then
  448.                 Instance.new("Model", workspace).Name = "GH0ST ("..string.lower(owner.Name)..")"
  449.                 if bodytype == "Humanoid" then
  450.                     local human0id = Instance.new("Humanoid", workspace:findFirstChild("GH0ST ("..string.lower(owner.Name)..")"))
  451.                     human0id.Died:connect(function()
  452.                         human0id.Parent:destroy()
  453.                     end)
  454.                 end
  455.             end
  456.             local model = workspace:findFirstChild("GH0ST ("..string.lower(owner.Name)..")")
  457.             for i,v in pairs(character:GetChildren()) do
  458.                 local found = nil
  459.                 for q,w in pairs(model:GetChildren()) do
  460.                     if v.Name == w.Name then
  461.                         if v.ClassName == "Accessory" or v.ClassName == "Hat" then
  462.                             found = v
  463.                         end
  464.                         if bodytype == "Humanoid" then
  465.                             if v.ClassName == "CharacterMesh" or v.ClassName == "ShirtGraphic" or v.ClassName == "Shirt" or v.ClassName == "Pants" then
  466.                                 found = v
  467.                             end
  468.                         end
  469.                     end
  470.                 end
  471.                 if found == nil then
  472.                     if v.ClassName == "Accessory" or v.ClassName == "Hat" then
  473.                         if v:findFirstChild("Handle") then
  474.                             local handdle = v.Handle
  475.                             local hatt = Instance.new("Accessory", model)
  476.                             hatt.Name = v.Name
  477.                             local limb = Instance.new("SpawnLocation", hatt)
  478.                             limb.Neutral = false
  479.                             limb.Name = "Handle"
  480.                             limb.Size = handdle.Size
  481.                             limb.CFrame = handdle.CFrame
  482.                             if bodytype == "Ghost" then
  483.                                 limb.Material = "Glass"
  484.                                 limb.Transparency = 0.9
  485.                             elseif bodytype == "Humanoid" then
  486.                                 limb.Material = handdle.Material
  487.                                 limb.Transparency = handdle.Transparency
  488.                             end
  489.                             limb.BrickColor = handdle.BrickColor
  490.                             limb.CanCollide = false
  491.                             limb:SetNetworkOwner(owner)
  492.                             if v.Handle:findFirstChildOfClass("SpecialMesh") then
  493.                                 v.Handle:findFirstChildOfClass("SpecialMesh"):Clone().Parent = limb
  494.                             end
  495.                         end
  496.                     elseif bodytype == "Humanoid" then
  497.                         if v.ClassName == "CharacterMesh" or v.ClassName == "ShirtGraphic" or v.ClassName == "Shirt" or v.ClassName == "Pants" then
  498.                             v:Clone().Parent = model
  499.                         end
  500.                     end
  501.                 end
  502.             end
  503.             for i,v in pairs(character:GetDescendants()) do
  504.                 local found = nil
  505.                 for q,w in pairs(model:GetDescendants()) do
  506.                     if v.Name == w.Name then
  507.                         if v.ClassName == "Part" or v.ClassName == "MeshPart" then
  508.                             found = v
  509.                         end
  510.                     end
  511.                 end
  512.                 if found == nil then
  513.                     if v.ClassName == "Part" or v.ClassName == "MeshPart" then
  514.                         if v.Name == "Handle" and v.Parent.ClassName ~= "Tool" then return end
  515.                         local limb = Instance.new("SpawnLocation", model)
  516.                         limb.Neutral = false
  517.                         limb.Name = v.Name
  518.                         limb.Size = v.Size
  519.                         limb.CFrame = v.CFrame
  520.                         if bodytype == "Ghost" then
  521.                             limb.Material = "Glass"
  522.                             limb.Transparency = 0.9
  523.                         elseif bodytype == "Humanoid" then
  524.                             limb.Material = v.Material
  525.                             limb.Transparency = v.Transparency
  526.                         end
  527.                         limb.BrickColor = v.BrickColor
  528.                         limb.CanCollide = false
  529.                         limb:SetNetworkOwner(owner)
  530.                         if v.Name == "Head" then
  531.                             if bodytype == "Humanoid" then
  532.                                 if character.Head:findFirstChildOfClass("Decal") then
  533.                                     character.Head:findFirstChildOfClass("Decal"):Clone().Parent = limb
  534.                                 end
  535.                             end
  536.                             if v:findFirstChildOfClass("SpecialMesh") then
  537.                                 v:findFirstChildOfClass("SpecialMesh"):Clone().Parent = limb
  538.                             end
  539.                         end
  540.                     end
  541.                 end
  542.             end
  543.         else
  544.             if workspace:findFirstChild("GH0ST ("..string.lower(owner.Name)..")") then
  545.                 workspace:findFirstChild("GH0ST ("..string.lower(owner.Name)..")"):destroy()
  546.             end
  547.         end
  548.     else
  549.         if workspace:findFirstChild("GH0ST ("..string.lower(owner.Name)..")") then
  550.             workspace:findFirstChild("GH0ST ("..string.lower(owner.Name)..")"):destroy()
  551.         end
  552.     end
  553. end
Add Comment
Please, Sign In to add comment