Hello. I've inserted an script that makes first person look way realistic (but it makes forced first person) so I've put an ScreenGui with a ButtonText that makes you "toggle" between first and third person, obviously I put a code in a LocalScript, so the function may work only in the client, but didn't worked. let me put the script.
function myfunction() game.StarterGui.Camera.Disabled = false game.StarterGui.PutMeInStarterGui.Disabled = false end game.StarterGui.Screen.TextButton.MouseButton1Click:Connect(myfunction)
I know it can't be toggled to Disabled = true but is just a prototype.
I've put it in ServerScriptService and didn't work, what can I do?
greetings.
You are making direct changes to the StarterGui, it is not what is appearing to the player, but a system that replicates what is in it to the player when he first enters the game, hence the name (Starter) Gui.
For your code to work, you can use the parent system, or directly access the Gui that is on the player you are alteraldo on, just use a LocalPlayer to identify the player, and PlayerGui to modify the Gui that appears on the screen.
local Player = game.Players.LocalPlayer -- This is the player. local PlayerGui = Player:WaitForChild("PlayerGui") -- This is the player Gui.
You need to use WaitForChild because PlayerGui is not added at once, it can take time to appear sometimes if the player is having trouble loading due to poor internet connection.
function myfunction() PlayerGui.Camera.Disabled = false PlayerGui.PutMeInStarterGui.Disabled = false end PlayerGui.Screen.TextButton.MouseButton1Click:Connect(myfunction)
I hope I have helped you. If you have any questions, you can ask.
:)