#MainMenu buttons and text label staying visible after the player chooses new game/continue

1 messages · Page 1 of 1 (latest)

cursive sage
#

Snippets:

local TweenService = game:GetService("TweenService")
local button = script.Parent
local player = game.Players.LocalPlayer
local gui = button.Parent
local fade = gui:WaitForChild("Fade")
local raftSpawn = workspace:WaitForChild("PlayerRaftSpawn")
local cameraPart = workspace:WaitForChild("CameraPart")
local camera = workspace.CurrentCamera

camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = cameraPart.CFrame

local function fadeTween(targetTransparency, duration)
    fade.Visible = true
    local tween = TweenService:Create(fade, TweenInfo.new(duration), {BackgroundTransparency = targetTransparency})
    tween:Play()
    tween.Completed:Wait()
end

local function fadeTeleport()
    fadeTween(0, 0.6)

    local char = player.Character or player.CharacterAdded:Wait()
    local hrp = char:WaitForChild("HumanoidRootPart")

    hrp.CFrame = raftSpawn.CFrame + Vector3.new(0,3,0)

    local tween = TweenService:Create(camera, TweenInfo.new(1), {CFrame = CFrame.new(hrp.Position + Vector3.new(0,10,15), hrp.Position)})
    tween:Play()
    tween.Completed:Wait()

    camera.CameraType = Enum.CameraType.Custom

    fadeTween(1, 0.6)

    fade.Visible = false
end

button.MouseButton1Click:Connect(fadeTeleport)
#

Heres the other one and the first one is for a new game and to continue

#
local player = game.Players.LocalPlayer
local camera = workspace.CurrentCamera
local cameraPart = workspace:WaitForChild("CameraPart") 

local function setMenuCamera()
    camera.CameraType = Enum.CameraType.Scriptable
    camera.CFrame = cameraPart.CFrame
end

setMenuCamera()

player.CharacterAdded:Connect(function(char)
    wait(0.1)
    setMenuCamera()
end)
#

I have a part names PlayerRaftSpawn above the raft and when i try to play the game and click new game it fades black but then it pauses and doesnt switch from CameraPart to the built in camera that follows the players HRP. and when i check the game from the free cam, it just shows me in the air and it probably drops me into the water when the fading pauses after clicking a button

#

please someone help

slim jay
#

did you set the cframe to the hrp?

cursive sage
slim jay
#

camera.CFrame

#

You set the cameratype to custom

cursive sage
slim jay
#

.-.

slim jay
cursive sage
#

Imma update the post

#

MainMenu buons and text labe staying visible after the player chooses either new game continue