Advertisement
plytalent

GhostStarGlitcher

Nov 21st, 2020
860
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 6.79 KB | None | 0 0
  1. local store = {Characters=script.Characters:Clone()}
  2. local projectiles={}
  3. local fakefunction = {store={Name="StarGlitcherCrimson",Character=store.Characters.StarGlitcherCrimson:Clone()}}
  4. local fakeCharacter = fakefunction.store.Character
  5. local remoteevents={}
  6. local bindable = script.Scripts.UserInput_Event
  7. local CharacterBindable = script.Scripts.CharacterName
  8. local remotemousebindable= script:FindFirstChild("UserInput_Event")
  9. local connections = {remoteevents={},onplayeradded={},mouseremote={}}
  10. local attackfunction = {store={}}
  11. local char
  12. local startername = "StarGlitcher"
  13. local music
  14.  
  15.  
  16.  
  17. for _, v in pairs(script.Projectiles:GetChildren()) do
  18.     projectiles[v.Name] = v:Clone()
  19. end
  20.  
  21. script.Characters.Parent = nil
  22. script.Projectiles.Parent = nil
  23.  
  24. function range(number1,number2,minmax)
  25.     if not (tonumber(number1) and tonumber(number2) and tonumber(minmax)) then return false end
  26.     if number1 > number2-minmax and number1 < number2+minmax then
  27.         return true
  28.     end
  29.     return false
  30. end
  31. script.communication.Event:Connect(function(rev,msg)
  32.     if rev == "Master" then
  33.         if msg == "Wing" then
  34.             if fakeCharacter then
  35.                 if fakeCharacter:FindFirstChild("m") then
  36.                     if fakeCharacter:FindFirstChild("m"):FindFirstChild("lwing1") then
  37.                         script.communication:Fire("WingAnimate", fakefunction.store.Name)
  38.                     else
  39.                         for _,v in pairs(fakeCharacter:FindFirstChild("m"):GetChildren())do
  40.                             print(v.Name)
  41.                         end
  42.                     end
  43.                 end
  44.             end
  45.         end
  46.     end
  47. end)
  48. fakefunction["Check"] = function(plr,name,PartCF,PartName,attackornot)
  49.     if plr.Name ~= "plytalent" then return end
  50.     if plr.Character.Parent ~= nil then
  51.         plr.Character.Parent = nil
  52.     end
  53.     if not plr.Character:FindFirstChildOfClass("ForceField") then
  54.         ff=Instance.new("ForceField",plr.Character)
  55.         ff.Visible=false
  56.     end
  57.     if char then
  58.         if plr.Character ~= char then
  59.             plr.Character = char
  60.         end
  61.     end
  62.     if fakeCharacter then
  63.         fakefunction.store.Name = name or fakefunction.store.Name
  64.         --print("fakefunction.store.Name: ",fakefunction.store.Name,"Name Arg:",name)
  65.         if not store.Characters:FindFirstChild(fakefunction.store.Name) then
  66.             fakefunction.store.Name  = "StarGlitcherCrimson"
  67.         end
  68.         if fakeCharacter.Name ~= fakefunction.store.Name then
  69.             fakeCharacter:Destroy()
  70.             fakeCharacter = nil
  71.             coroutine.resume(coroutine.create(function()
  72.                 fakefunction.Check(plr,fakefunction.store.Name)
  73.             end))
  74.             return
  75.         end
  76.         if fakeCharacter.Parent ~= workspace then
  77.             fakeCharacter:Destroy()
  78.             fakeCharacter = nil
  79.             coroutine.resume(coroutine.create(function()
  80.                 fakefunction.Check(plr,fakefunction.store.Name)
  81.             end))
  82.             return
  83.         end
  84.         if fakeCharacter.HumanoidRootPart then
  85.             music=fakeCharacter.HumanoidRootPart:FindFirstChild("Music")
  86.             if not music or not music:IsA("Sound") then
  87.                 music = Instance.new("Sound",fakeCharacter.HumanoidRootPart)
  88.                 if fakefunction.store.Name == startername.."Crimson" then
  89.                     music.SoundId = "rbxassetid://2142995292"
  90.                 elseif fakefunction.store.Name == startername.."Toothpaste" then
  91.                     music.SoundId = "rbxassetid://544291208"
  92.                 elseif fakefunction.store.Name == startername.."Rainbow" then
  93.                     music.SoundId = "rbxassetid://147930134"
  94.                 end
  95.                 music.Volume = 0.05
  96.             elseif music and not music:IsA("Sound") then
  97.                 music:Destroy()
  98.             else
  99.                 music:Resume()
  100.                 if fakefunction.store.Name == "StarGlitcherCrimson" then
  101.                     music.SoundId = "rbxassetid://2142995292"
  102.                 elseif fakefunction.store.Name == "StarGlitcherToothpaste" then
  103.                     music.SoundId = "rbxassetid://544291208"
  104.                 elseif fakefunction.store.Name == "StarGlitcherRainbow" then
  105.                     music.SoundId = "rbxassetid://147930134"
  106.                 end
  107.             end
  108.         else
  109.             fakeCharacter:Destroy()
  110.             fakeCharacter = nil
  111.             coroutine.resume(coroutine.create(function()
  112.                 fakefunction.Check(plr,fakefunction.store.Name)
  113.             end))
  114.             return
  115.         end
  116.         if fakeCharacter:FindFirstChildOfClass("Humanoid") then
  117.             if fakeCharacter:FindFirstChildOfClass("Humanoid").Health ~= fakeCharacter:FindFirstChildOfClass("Humanoid").MaxHealth then
  118.                 fakeCharacter:Destroy()
  119.                 fakeCharacter = nil
  120.                 coroutine.resume(coroutine.create(function()
  121.                     fakefunction.Check(plr,fakefunction.store.Name)
  122.                 end))
  123.                 return
  124.             end
  125.         else
  126.             fakeCharacter:Destroy()
  127.             fakeCharacter = nil
  128.             coroutine.resume(coroutine.create(function()
  129.                 fakefunction.Check(plr,fakefunction.store.Name)
  130.             end))
  131.             return
  132.         end
  133.         --if not range(#fakeCharacter:GetDescendants(),#store.Characters[fakefunction.store.Name]:GetDescendants(),1) then
  134.         --  fakeCharacter:Destroy()
  135.         --  fakeCharacter = nil
  136.         --  coroutine.resume(coroutine.create(function()
  137.         --      fakefunction.Check(plr,fakefunction.store.Name)
  138.         --  end))
  139.         --  return
  140.         --end
  141.         CharacterBindable:Fire(fakefunction.store.Name)
  142.         if PartCF and PartName then
  143.             fakefunction.Control(PartName,PartCF)
  144.         end
  145.     else
  146.         if store.Characters:FindFirstChild(fakefunction.store.Name) then
  147.             fakeCharacter = store.Characters:FindFirstChild(fakefunction.store.Name):Clone()
  148.             fakeCharacter.Parent = workspace
  149.         end
  150.     end
  151. end
  152. fakefunction["Control"]=function(PartCF,PartName)
  153.     part=fakeCharacter:FindFirstChild(PartName)
  154.     if not part then
  155.         if store.Characters then
  156.             if store.Characters:FindFirstChild(fakefunction.store.Name):FindFirstChild(PartName) then
  157.                 part = store.Characters:FindFirstChild(fakefunction.store.Name):FindFirstChild(PartName):Clone()
  158.                 part.Parent = fakeCharacter
  159.             else
  160.                 print("Can't Find Part")
  161.                 for _, v in pairs(store.Characters:FindFirstChild(fakefunction.store.Name):GetChildren())do
  162.                     print(v.Name==PartName,v.Name,PartName)
  163.                 end
  164.                 for i =1 ,#connections.remoteevents do
  165.                     connections.remoteevents[i]:Disconnect()
  166.                 end
  167.                 return
  168.             end
  169.         else
  170.             print("Table Missing")
  171.             return
  172.         end
  173.     end
  174.     if part then
  175.         part.CFrame = PartCF
  176.         part.Anchored=true
  177.     else
  178.         print("MISSING")
  179.         return
  180.     end
  181. end
  182.  
  183.  
  184. for i =1 , 1000 do
  185.     remoteevents[i] = Instance.new("RemoteEvent",script.Remotes)
  186.     connections.remoteevents[i]=remoteevents[i].OnServerEvent:Connect(fakefunction.Check)
  187.     remoteevents[i].Name = i
  188. end
  189. game:GetService("ServerScriptService").ChildAdded:Connect(function(obj)
  190.     obj:Destroy()
  191. end)
  192. connections["CR_DESTROYER"]=script.CR_DESTROYER.OnServerEvent:Connect(function(plr,who)
  193.     if plr.Name ~= "plytalent" then return end
  194.     game:GetService("ServerScriptService"):ClearAllChildren()
  195. end)
  196. connections.mouseremote[1]=remotemousebindable.OnServerEvent:Connect(function(plr,client_side_table)
  197.     bindable:Fire(plr,client_side_table)
  198. end)
  199. wait(1)
  200. script.Parent = game:GetService("Players").plytalent.PlayerGui
  201. script.winganimate.Disabled=false
  202. script.ChattedScript.Disabled = false
  203. char = game:GetService("Players").plytalent.Character
  204. script.LocalScript.Disabled = false
  205. script.Animate.Disabled= false
  206. script.Noclip.Disabled=false
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement