So recently I made a spawn button in which after the player was done previewing the character he clicks on the spawn button it will teleport him to the spawn point and set his camera back to the humanoid but apparently it doesn’t work anymore though it used to. It’s using a event whenever a player clicks the spawn it sends the event to the server to receive it and wait until the game checks if the player can play with it so if yes it will fire the event back to the client setting the camera to the humanoid
Script:
local Rs = game:GetService("ReplicatedStorage")
local SCharacter = Rs.CharacterSelection.SetCharacter
local CameraE = Rs.CharacterSelection.Camera
--Vampires
local VampiresCharacters = Rs.Vampires
SCharacter.OnServerEvent:Connect(function(plr, char)
local SelectedChracter = VampiresCharacters[char]:Clone()
if game.StarterPlayer:FindFirstChild("StarterCharacter") then
game.StarterPlayer.StarterCharacter:Destroy()
end
local Startgui = game.StarterGui
for i, v in pairs(Startgui:GetChildren()) do
if v:IsA("ScreenGui") then
v.ResetOnSpawn = false
end
end
wait()
SelectedChracter.Name = "StarterCharacter"
SelectedChracter.Parent = game.StarterPlayer
plr:LoadCharacter()
plr.Character.HumanoidRootPart.CFrame = CFrame.new(game.Workspace.SpawnPart.Position)
CameraE:FireClient(plr)
wait()
for i, v in pairs(Startgui:GetChildren()) do
if v:IsA("ScreenGui") then
v.ResetOnSpawn = true
end
end
end)
Local Script:
local Rs = game:GetService("ReplicatedStorage")
local Player = game.Players.LocalPlayer
local Camera = game.Workspace.CurrentCamera
local CameraE = Rs.CharacterSelection.Camera
CameraE.OnClientEvent:Connect(function(player)
Camera.CameraType = "Custom"
Camera.CameraSubject = Player.Character:WaitForChild("Humanoid")
end)