So basically I have a ModuleScript in ServerScriptService which calls :FireAllClients() on a RemoteEvent. The purpose of the modulescript and the localscript is the modulescript sends over the parts that the localscript will change it's camera to.
The problem though is that.. Whenever the modulescript fires all clients the client on the overhand receives a "nil" table. No errors, just a empty table. Even though I included a table of the parts I want the player to change their camera to. And I double-checked the model that contains the camera-view parts and It is not empty.
I'm not totally sure if you can do filterning enabled stuff on a ModuleScript.
If no then how else could I do that? ModuleScript gives ServerScript the table and fires clients?
If yes then it is my script not working: Here is my module script responsible for that:
function TeamModule.AddMapToWorkspace()
print(map.Name)
local Clone = map:Clone()
Clone.Parent = game.Workspace
TeamModule.ProcessMap(map.Name)
wait(0.6)
print(map.CutsceneParts.Part.Transparency)
print(map.CutsceneParts)
local children = map:WaitForChild("CutsceneParts"):GetChildren()
CutsceneRemoteEvent:FireAllClients(children, 3)
end
Here is my local script responsible of receiving and changing the camera:
local function InterpolateCamera(Parts, Speed)
print("Interpolating Camera")
Camera.CameraType = "Scriptable"
print(Parts[1])
for i,v in pairs(Parts) do
Camera:Interpolate(Parts[i].CFrame, Parts[i + 1].CFrame, 2)
wait(2)
end
ResetCamera() -- just turns back camera to normal.
end
RemoteEvent.OnClientEvent:Connect(InterpolateCamera)
Thanks for reading, if you have questions then tell me
