I am trying to make an RPG. But this Camera Manipulation script isn't working.
There is a Play Button. Whenever you press the button, it takes you into the game.
My problem is that whenever I get killed/bloxxed, I respawn with a play button on my screen. I just need to know how to get rid of it, when you press the button
Here is the script
--// Client
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Camera = workspace.CurrentCamera
--// CameraParts
local Cameras = workspace:WaitForChild('Cameras')
local CameraPart1 = Cameras:WaitForChild('CameraPart1')
local CameraPart2 = Cameras:WaitForChild('CameraPart2')
--//GUIs
local PlayButton = script.Parent.PLAY
--// Main
repeat wait()
Camera.CameraType = Enum.CameraType.Scriptable
until Camera.CameraType == Enum.CameraType.Scriptable
Camera.CFrame = CameraPart1.CFrame
for Num = 0,1,.01 do
Camera.CFrame = CameraPart1.CFrame:lerp(CameraPart2.CFrame,Num)
game:GetService('RunService').RenderStepped:Wait()
end
PlayButton.MouseButton1Click:Connect(function()
Camera.CameraType = Enum.CameraType.Custom
PlayButton:Destroy()
end)
I hope I explained my problem well. If anyone reads this, is it ok if you find the solution and explain why this is happening.

1 comment
Thank you