Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

For some reason, the table the client receives is nil?

Asked by 4 years ago
Edited 4 years ago

So I have a module script that fires a remote event to tell everyone to interpolate their camera with the given table (in the table there is parts). The module script recognizes that this is a table and can manipulate it however it wants,

But.. Whenever I send the table to a client the table's values turn nil. (Table turns empty). There is nothing setting it to nil and the client just loops the table and interpolates it's camera.

The module script goes into the map and searches for a group of parts. In the :FireAllClients() function the first argument is the table. Next is the speed of the interpolation.

I'm not sure why the table turned nil.. it's very odd for the module script to recognize and manipulate the table while the client can't.

If you would like here are some snippets from the module script and the local script: I included printing the part's transparency for print debugging.

Module script snippet:

function TeamModule.AddMapToWorkspace()
    print(map.Name)
    local Clone = map:Clone()
    Clone.Parent = game.Workspace
    print(map.CutsceneParts.Part.Transparency) -- prints a part's transparency
    print(map.CutsceneParts) -- prints the name of the model
    CutsceneRemoteEvent:FireAllClients(map.CutsceneParts:GetChildren(), 3)
end

local script snippet:

local function ResetCamera()
    Camera.CameraType = Enum.CameraType.Track
    Camera.CFrame = Character.Head.CFrame
end

local function InterpolateCamera(Parts, Speed)
    print("Interpolating Camera")
    Camera.CameraType = "Scriptable"
    print(#Parts) -- prints nil :(
    for i,v in pairs(Parts) do -- will not loop causes the values inside the table are nil
        Camera:Interpolate(Parts[i].CFrame, Parts[i + 1].CFrame, 2)
        wait(2)
    end
    ResetCamera()
end

It's a very odd problem and I tried looking over the web to see if anyone has the same problem and it seems not. Thank you for viewing

0
"print(Parts[1]).Transparency"?? That won't even compile. incapaz 195 — 4y
0
Try more debugging. Like print(#Parts) incapaz 195 — 4y
0
I tried that and the table that is passed in will still be nil. I’m gonna update my question anyway. 123nabilben123 499 — 4y
0
Wait so what line is the error on? namespace25 594 — 4y
0
There’s no errors in the script is just when I send a table to the client it turns out to be empty. Even though I exactly sent a model with all it’s children inside of it. 123nabilben123 499 — 4y

Answer this question