I made script to char selection but when I click button my camera dont change to custom and my character after die dont change into selected char here is script of char selection:local plr = game.Players.LocalPlayer
local camera = workspace.CurrentCamera
local selectedChar = nil
if not selectedChar then
camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = workspace.CameraPart.CFrame
end
script.Parent.CharacterSelection.Visible = true
for _, CharButton in ipairs(script.Parent.CharacterSelection:GetDescendants()) do
if CharButton:IsA("TextButton") and CharButton:HasTag("CharSelection") then
local isClicked = false
CharButton.MouseButton1Click:Connect(function()
if isClicked then return end
isClicked = true
selectedChar = CharButton.Name
script.Parent.CharacterSelection.Visible = true
game.ReplicatedStorage.Events.CharSelect:FireServer(CharButton.Name)
camera.CameraType = Enum.CameraType.Custom
plr.CharacterAdded:Wait()
camera.CameraSubject = plr.Character:WaitForChild("HumanoidRootPart")
end)
end
end
game.Players.LocalPlayer.CharacterAdded:Connect(function()
if not selectedChar then return end
camera.CameraType = Enum.CameraType.Custom
game.ReplicatedStorage.Events.CharSelect:FireServer(selectedChar)
end)