Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why does my Play Button keep popping up?

Asked by 5 years ago
Edited 5 years ago

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 answer

Log in to vote
0
Answered by 5 years ago

It keeps popping up because you have ResetPlayerGuiOnSpawn set to true in the StarterGui. Go to StarterGui and untick ResetPlayerGuiOnSpawn.

0
Thank you Littlenatnat8508 4 — 5y
Ad

Answer this question