How to make a script COMPLETELY STOP?
Hey again, this is my 3rd question I've asked today lol, sorry about that!
My question is how to make a script completely stop, like not run again once i die. I have a loading screen thing going on and i really like it, but i dont want players to see the whole thing again once they die, so far i've tried:
1 | script.parent.GamePopup:Destroy() |
This hasnt worked, so then i tried:
And that also didnt work, if you're wondering here is my script (there are no loops in it)
01 | script.Parent.GamePopup.Background.Visible = true |
02 | script.Parent.GamePopup.Visible = true |
03 | script.Parent.GamePopup.Teleporting.Visible = true |
04 | script.Parent.GamePopup.Wait.Visible = true |
05 | script.Parent.GamePopup.Lib.Visible = true |
07 | local Tween = game:GetService( "TweenService" ) |
10 | local Sidebar = script.Parent:WaitForChild( "Sidebar" ) |
11 | local Title = Sidebar:WaitForChild( "Logo" ) |
13 | local MenuOver = script.Parent:FindFirstChild( "MenuOver" ) |
20 | local GamePopup = script.Parent:WaitForChild( "GamePopup" ) |
21 | local Background = GamePopup:WaitForChild( "Background" ) |
22 | local Teleporting = GamePopup:WaitForChild( "Teleporting" ) |
23 | local Wait = GamePopup:WaitForChild( "Wait" ) |
24 | local Lib = GamePopup:WaitForChild( "Lib" ) |
26 | local Cam = game.Workspace.CurrentCamera |
27 | local CamPoints = workspace:WaitForChild( "CameraPoints" ) |
32 | local SlideInSidebar = Tween:Create(Sidebar,TweenInfo.new( 0.69 , Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0 , false , 0 ), { Position = UDim 2. new( 0 , 0 , 0 , 0 ) } ) |
33 | local SlideOutSidebar = Tween:Create(Sidebar,TweenInfo.new( 0.69 , Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0 , false , 0 ), { Position = UDim 2. new(- 1 , 0 , 0 , 0 ) } ) |
42 | script.Parent.GamePopup.Background.Image = images [ math.random( 1 , #images) ] |
45 | script.Parent.GamePopup.Background.Image = images [ math.random( 1 , #images) ] |
48 | script.Parent.GamePopup.Background.Image = images [ math.random( 1 , #images) ] |
51 | script.Parent.GamePopup.Background.Visible = false |
52 | script.Parent.GamePopup.Visible = false |
53 | script.Parent.GamePopup.Teleporting.Visible = false |
54 | script.Parent.GamePopup.Wait.Visible = false |
55 | script.Parent.GamePopup.Lib.Visible = false |
58 | Cam.CameraType = Enum.CameraType.Scriptable |
63 | local function TweenCameraPos(Point, Speed) |
64 | Tween:Create(Cam, TweenInfo.new(Speed, Enum.EasingStyle.Linear), { CFrame = Point.CFrame } ):Play() |
68 | Cam.CFrame = CamPoints:FindFirstChild( "1" ).CFrame |
69 | TweenCameraPos(CamPoints:FindFirstChild( "2" ), 4 ) |
71 | Cam.CFrame = CamPoints:FindFirstChild( "3" ).CFrame |
72 | TweenCameraPos(CamPoints:FindFirstChild( "4" ), 4 ) |
74 | Cam.CFrame = CamPoints:FindFirstChild( "5" ).CFrame |
75 | TweenCameraPos(CamPoints:FindFirstChild( "6" ), 4 ) |
77 | Cam.CFrame = CamPoints:FindFirstChild( "7" ).CFrame |
78 | TweenCameraPos(CamPoints:FindFirstChild( "8" ), 4 ) |
81 | game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid |
82 | game.Workspace.CurrentCamera.CameraType = "Custom" |
87 | script.Parent.GamePopup:Destroy() |
Anyway to make the script stop completely forever?