Why is my 3d text button invisible?

How is the camera set to the main menu right now?

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.

1 Like

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'
1 Like

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.

  1. Add a LocalPlayer variable
  2. Connect to the CharacterAdded event on the LocalPlayer
  3. Inside of that connection, disconnect the connection you want to get rid of
  4. And then show me the code and I’ll help
    you restore the camera.

Should I do this in my cameraMove script that sets the placement of the camera?

Yes, you could make another one but it’d be a bit redundant.

1 Like

Okay, this might be a little over the top, but as a newer scripter, I DID IT FIRST TRY LETS GO!!!
Here’s what I added:

game.ReplicatedStorage.loadCharacter.OnClientEvent:Connect(
	Connection:Disconnect()
)

Wait did that actually work like that? If so, I didn’t even know that syntax was accepted.:skull:

And not quite.

I was confused about the “OnClientEvent” but somehow it worked. I’m scared of messing it up so I kinda wanna quit while I’m ahead lol

I was referring to CharacterAdded on LocalPlayer, but I may not have that made that clear.

local localPlayer = game:GetService("Players").LocalPlayer

localPlayer.CharacterAdded:Connect(function(char)
    Connection:Disconnect()
end)

And your script wouldn’t work unless you used

event:FireClient(Player)

After you loaded the character.

(Which either work ftr)

Oh, weird. I’ll swap out the scripts and see if anything changes.
That worked too. This is really weird. Anyways, THANK. YOU. SO. MUCH.

1 Like

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.

Wait did it fix the camera too?? I hadn’t even addressed that yet.

Yeah, it put the camera back to the player.

1 Like

No idea how it did that to be honest, but have a good night! :slight_smile:

Scripting is weird sometimes I guess. Have a good night too!

1 Like