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

Roblox camera menu script not working abruptly, anyone help?

Asked by
ur3z 0
4 years ago

My roblox camera script for my menu abruptly stopped working for no reason, here are the scripts.

Camera script itself:

game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)

local player = game.Players.LocalPlayer
local Camera = workspace.CurrentCamera

repeat wait() until player.Character

Camera.CameraType = "Scriptable"
Camera.CFrame = game.Workspace.Menu.CFrame



The "play" button which starts the game and respawns the character:

local replicatedStorage = game:GetService("ReplicatedStorage")
local respawnEvent = replicatedStorage:WaitForChild("Respawn_Plr") 
local plr = game.Players.LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
    if plr.TeamColor == BrickColor.new("Rust") then

    else
    game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, true)

    script.Parent.Parent.Enabled = false
    wait(0.5)
    respawnEvent:FireServer()
    workspace.CurrentCamera.CameraType = Enum.CameraType.Custom

end 
end)


The part for the camera is called "Menu" and I don't know why it stopped working, now whenever someone plays the game the camera is stuck in the spawn box (which the menu part isnt at, or meant to be there)

https://prnt.sc/pwlsdw

If someone could help that would be great.

0
Imagine using a loop in the place of an event listener. player.CharacterAdded exists, you know... User#29813 0 — 4y
0
As for your issue, setting the cameratype to custom doesn't change the position of the camera. User#29813 0 — 4y
0
@AetherProgrammer If you read the first script, I'm changing the camera type to scriptable and CFraming it to a part in the menu called workspace. ur3z 0 — 4y
0
That's not what I'm talking about. You never set the camera subject back to the humanoid. https://developer.roblox.com/en-us/api-reference/property/Camera/CameraSubject User#29813 0 — 4y

Answer this question