Advertisement
GaryScripts

mainscript

Mar 20th, 2022
675
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.62 KB | None | 0 0
  1. local PPS = game:GetService("ProximityPromptService")
  2. local position = workspace.jellybeanPortrait.Position
  3.  
  4. PPS.PromptTriggered:Connect(function(plr) --triggers function
  5.     workspace.jellybeanPortrait:Destroy()
  6.    
  7.     local explosion1 = Instance.new("Explosion", workspace)
  8.     explosion1.Position = position
  9.        
  10.     local sound = game.ServerStorage["Rocket Launcher Fire"]:Clone()
  11.     sound.Parent = workspace.SoundPart
  12.     sound:Play()
  13.    
  14.     workspace.TextPart.SurfaceGui.TextLabel.Text = "THE ENEMY HAS BEEN DEFEATED"
  15.    
  16.     local allPartsComputer = workspace.ComputerMAIN:GetChildren()
  17.     local allPartsPictureFrame = workspace["Picture Frame"]:GetChildren()
  18.    
  19.     if allPartsComputer and allPartsPictureFrame ~= nil then
  20.         for i, v in pairs(allPartsComputer) do
  21.             v.Anchored = false
  22.             v.Velocity = Vector3.new(0, 28, 50)
  23.            
  24.             if v.Name == "Screen" then
  25.                 v.Anchored = false
  26.                 v.Velocity = Vector3.new(0, 28, 50)
  27.                
  28.                 v.Decal:Destroy()
  29.             end
  30.         end
  31.  
  32.         for i, v in pairs(allPartsPictureFrame) do
  33.             v.Anchored = false
  34.             v.Velocity = Vector3.new(35, 28, 0)
  35.         end
  36.     end
  37.    
  38.     game.ReplicatedStorage.KillEvent:FireAllClients()
  39.     game.ReplicatedStorage.ShakeEvent:FireAllClients(0.686)
  40.    
  41.     task.wait(2)
  42.    
  43.     for i, v in pairs(allPartsComputer) do
  44.         repeat
  45.             task.wait(0.03)
  46.             v.Transparency = v.Transparency + 0.05
  47.            
  48.         until v.Transparency >= 1
  49.        
  50.         v:Destroy()
  51.     end
  52.  
  53.     for i, v in pairs(allPartsPictureFrame) do
  54.         repeat
  55.             task.wait(0.03)
  56.             v.Transparency = v.Transparency + 0.05
  57.            
  58.         until v.Transparency >= 1
  59.        
  60.         v:Destroy()
  61.     end
  62.    
  63.     script.Parent:Destroy() --destroys proximity prompt
  64.     script:Disconnect()
  65. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement