Hey there, I am unable to get my player’s camera to revert back from its current manipulation. (tied to an object in another script, when buttons are pressed)
Its because I can’t seem to get the correct humanoid or character.
Code:
--Variables and code for reserve server stuff
local MainMusic = game.SoundService["Distorted Reality Perception - Leon Riskin"]
local reserve = script.Parent.GameTypeButton1
local debounce = false
local ScreenGui = script.Parent.Parent
reserve.MouseButton1Click:Connect(function()
if debounce then return end
debounce = true
local ts = game:GetService("TeleportService")
local access = ts:ReserveServer(game.PlaceId)
ts:TeleportToPrivateServer(game.PlaceId, access, game.Players:GetPlayers())
warn("Teleporting everybody...")
task.wait(5)
debounce = false
end)
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local Character = player:WaitForChild("Character")
local Humanoid = Character:WaitForChild("Humanoid")
local Camera = workspace.CurrentCamera
local Players = game:GetService("Players")
local isReserved = game.PrivateServerId ~= "" and game.PrivateServerOwnerId == 0
if isReserved == true then
print("reserved is true")
ScreenGui.Enabled = false
Camera.CameraType = Enum.CameraType.Custom
Camera.CameraSubject = game.Players.Player.Humanoid
MainMusic.Playing = false
end