And as another note I’d recommend adding one security check to the server. And utilizing WaitForChild / GetService as good practice.
local loaded = {}
local replicatedStorage = game:GetService("ReplicatedStorage")
local event = replicatedStorage:WaitForChild("loadCharacter")
event.OnServerEvent:Connect(function(player)
if not loaded[player] then
loaded[player] = true
player:LoadCharacter()
end
end)
This makes it so you can’t load more than once. Exploiters (more commonly referred to as hackers which is not correct) could just spam this remote and start loading their character super fast and make your server laggy. And then always try to use GetService and WaitForChild when you can for best practice.
I have this script (not mine) as a LocalScript in StarterPlayerScripts:
local CameraStart = workspace:WaitForChild("cameraStart")
local camera = workspace.CurrentCamera
Connection = camera:GetPropertyChangedSignal("CameraType"):Connect(function()
if camera.CameraType ~= Enum.CameraType.Scriptable then
camera.CameraType = Enum.CameraType.Scriptable
end
end)
camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = CameraStart.CFrame
-- Remove Connection When Done -> 'Connection:Disconnect'
So, this time I’m going to tell what to do instead of writing the code because I want you to be able to learn. Just let me know any questions! It’s pretty simple.
Add a LocalPlayer variable
Connect to the CharacterAdded event on the LocalPlayer
Inside of that connection, disconnect the connection you want to get rid of
And then show me the code and I’ll help
you restore the camera.
I’m just gonna stop now, and get some sleep. Again, thanks for all the help. My main menu is 100% working now and its due to you. I appreciate it so much.