How do i get rid of camera menu after death

I have made a camera menu its good but i’m not sure how to get rid of it after death.

Here is the script:
local Player = game.Players.LocalPlayer

local Character = Player.Character or Player.CharacterAdded:Wait()

local Camera = workspace.CurrentCamera

local PlayButton = script.Parent.PLAY

repeat wait()

Camera.CameraType = Enum.CameraType.Scriptable

until Camera.CameraType == Enum.CameraType.Scriptable

Camera.CFrame = workspace.CameraPart.CFrame

PlayButton.MouseButton1Click:Connect(function()

Camera.CameraType = Enum.CameraType.Custom

PlayButton:Destroy()

end)

Thanks you for yout time hope you can help. :grinning:

Do you want to get rid of the Gui or the Camera?

1 Like

both :smile: that was a fast message.

Assuming this is a descendant of a ScreenGui, you could just disable ResetOnSpawn of that ScreenGui in the properties menu.


P.S: Be sure to put your code in a code block for better readability.

ie.
```
Code here
```

Result:

Code here
2 Likes

smart idea i will do that but if there is a different way i will do that to.

It’s Pretty Easy! you detect the player die ( Humanoid. died ) or you just set the property to reset on spawn to false

for the camera, you just change the camera type back

1 Like

i will have a look at that to.

If you don’t want the ScreenGui to show up any more after your character respawns, consider doing this (only when the player first joins):

  1. Cut and paste your Menu Gui into ReplicatedStorage
  2. Insert a server side script into ServerScriptService and copy paste this:
game.Players.PlayerAdded:Connect(function(Player) --Runs when the player joins
    local PlayerGui = Player:WaitForChild('PlayerGui') --Where player GUIs are stored
    local MenuGui = game.ReplicatedStorage:WaitForChild('MenuGui'):Clone() --The directory of the gui
    MenuGui.Parent = PlayerGui --Sets the parent
end

Make sure you change the directory to whatever the name of your ScreenGui is.

Hope this helps!

1 Like

Omg thanks so much you the best.