Server Script Remote only working for some joined players. (Nothing happening for the rest)

Hey everyone. So I’ve been struggling with properly understanding remote events and how they should be set up in general to achieve what I want. I’m trying to make a GUI which is capable of controlling a camera positioning script. These camera parts are all positioned around build areas I have in-game which will then be later activated to change every player’s in-game camera to be hovering over the showcased build. ( It’s just a build battle event game. )

I understand how the camera controlling script works and have already been able to activate the specific cutscenes for all players in-game with a chat command, but wanted to try and make a functioning gui with buttons that will activate the server script.

There are two issues that I’ve been facing. Firstly, everytime I run multiple local clients to test the script’s functionality, only around half of them actually have their cameras being manipulated and the other half just absolutely nothing happening. Secondly, when the scripts happen to work the server script runs the camera manipulating script without even being triggered. I believe this is due to an if statement not being properly implemented but everything I’ve tried has resulted in bugs so any help would be appreciated.

Here’s two local scripts that are both trying to achieve the detection of a button being pressed on the gui and firing the remote event. (I’m not sure which is correct and where they should exactly be located, one is inside the button itself and the other is inside StarterCharacterScripts.)

This is the local script in StarterCharacterScripts.

local rep = game.ReplicatedStorage
local b1 = game.StarterGui.ScreenGui.Builds.Build1
local specialEvent = rep:WaitForChild("CameraEvent")


if b1.Activated then

And this is the local script I put inside the button itself.

local replicatedStorage = game.ReplicatedStorage
local specialEvent = replicatedStorage:WaitForChild("CameraEvent")




Finally, here is the server script which carries out the camera manipulation.

local replicatedStorage = game:GetService("ReplicatedStorage")
local judgeCommandEvent = replicatedStorage:WaitForChild("CameraEvent")
local cameraAnimationService = require(script.CameraAnimationService)
local cameraFolder = workspace:WaitForChild("CameraFolder")


	cameraAnimationService:MoveCameraToPart(cameraFolder.A1, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut, 2)
	cameraAnimationService:MoveCameraToPart(cameraFolder.A12, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut, 4)
	cameraAnimationService:MoveCameraToPart(cameraFolder.A13, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut, 4)
	cameraAnimationService:MoveCameraToPart(cameraFolder.A14, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut, 4)
	cameraAnimationService:MoveCameraToPart(cameraFolder.A1, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut, 4)

Any help would be greatly appreciated as I’m terrible with remotes and still trying to learn scripting myself. I’ve tried adding waits in case some of the players weren’t loading in properly but that didn’t seem to help. And if there’s any way I can prevent the server script from running once before a remove is even fired while having the function in there that would also help. Also, I’ll attach some images which might help clarify what I’m trying to achieve.

1 Like

You must use PlayerGui, not StarterGui, objects that are in StarterGui will go to the player’s PlayerGui when they join the game. Also why don’t you use camera manipulation in local script.

Only 1 person will have access to this gui once everything is working and I already got the hang of that. But I’m trying to make it so that when the button is pressed the server script will make everyone’s cameras move at the same time. Here’s a little video showing multiple local players in-game but only some of them actually have their cameras moving when the button is pressed, others don’t seem to have anything happening. I can’t seem to figure out exactly why that is though.