#I want to disable a player
19 messages · Page 1 of 1 (latest)
when its true players cannot spawn until Player:LoadCharacter() is called
the problem with that is that I cannot set the camera of the main menu
how are you setting the camera
local cc = workspace.CurrentCamera
local camPart = workspace.CameraScenes.One.cam1
local player = game.Players.LocalPlayer
local char = player.Character
local mouse = player:GetMouse()
local button = script.Parent.Menu.Holdingframe.PlayBtn
repeat
wait()
until char
cc.CameraType = Enum.CameraType.Scriptable
local viewDist = 1
local connection = game:GetService("RunService").RenderStepped:Connect(function()
cc.CFrame = camPart.CFrame * CFrame.new(
(((mouse.X - mouse.ViewSizeX / 2) / mouse.ViewSizeX) * viewDist),
(((mouse.Y - mouse.ViewSizeY / 2) / mouse.ViewSizeY) * -viewDist),
0
)
game:GetService("RunService").RenderStepped:Wait()
end)
button.MouseButton1Click:Connect(function()
button.Parent:TweenPosition(UDim2.new(-2, 0, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Sine, 1)
wait(1)
if connection then
connection:Disconnect()
end
cc.CameraType = Enum.CameraType.Custom
cc.CameraSubject = game.Players.LocalPlayer.Character:FindFirstChildOfClass("Humanoid")
end)```
the basic thing of making the cameratype scriptable and assigning it to the camera part
and the X and Y things are something to make the camera move when the cursor does
and the camera doesnt move if Players.CharacterAutoLoads = false?
oh ik why
you are setting the CameraSubject to a player's humanoid when their character isnt loaded
should I do the event of loading the character in the button function?
yea when the button is clicked it loads the character
button.MouseButton1Click:Connect(function()
player:LoadCharacter()
button.Parent:TweenPosition(UDim2.new(-2, 0, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Sine, 1)
wait(1)
if connection then
connection:Disconnect()
end
cc.CameraType = Enum.CameraType.Custom
if game.Players.LocalPlayer.Character then do
cc.CameraSubject = game.Players.LocalPlayer.Character:FindFirstChildOfClass("Humanoid")
end
end)``` still doesnt work
print the humanoid and see if its there
honestly i give up on this it cant have a gui if its not loaded
so its impossible
it can, once you disable characterautoloads you have to clone the gui to the PlayerGui
ill try that
im gonna make it so all players spawn in a black room and when they press play they get tped to random spots in the map