Is not a valid member when it is

Hi everyone. I’m with a big problem.
My game says that an specific folder is not a valid member of workspace, while it does.
No big problems here, I would just need to make a WaitForChild() right? Wrong.
Here comes the real problem. It only says that it’s not a valid member in-game, in studio it runs normally.
And it’s not even a problem with time, because the script runs after a long time, when the model already is on the place it should be. Something even more strange, after I inserted WaitForChild() the logs in game says that the path is “CurrentMissionVan” while in studio, it is perfectly “CurrentMission.Van”
image
You can see the van here… It was there a lot of time before the error…
image

IMPORTANT THINGS
I’m not in team create.
No beta features being used
The game only brokes in client, in studio it runs perfectly

3 Likes

try doing FindFirstChild() instead.

1 Like

Hello! Could we get the script?

2 Likes

Ok… (going to send the full script)
This script runs:

local player = game:GetService('Players').LocalPlayer

local gui = player.PlayerGui:WaitForChild('StartCutscene')

local TweenService = game:GetService("TweenService")

local startCamera = script.Parent.CameraHandler

local subtitles = script.Parent.Subtitles

local fade = gui.Frame

local fadeText = fade.loading

local allEvents = gui.Frame.allEvents

local chapter1 = gui.Frame.Chapter1

local timeof = gui.Frame.Chapter1.TimeOfChange

local literal = gui.Frame.Chapter1.Literal

TweenService:Create(

fadeText,

TweenInfo.new(1),

{TextTransparency = 0}

):Play()

wait(1)

TweenService:Create(

fadeText,

TweenInfo.new(1),

{TextTransparency = 1}

):Play()

wait(1)

TweenService:Create(

fadeText,

TweenInfo.new(1),

{TextTransparency = 0}

):Play()

wait(1)

TweenService:Create(

fadeText,

TweenInfo.new(1),

{TextTransparency = 1}

):Play()

wait(1)

TweenService:Create(

fadeText,

TweenInfo.new(1),

{TextTransparency = 0}

):Play()

wait(1)

TweenService:Create(

fadeText,

TweenInfo.new(1),

{TextTransparency = 1}

):Play()

wait(1)

game:GetService("Workspace").Sounds.SFX.RadioStatic:Play()

wait(0.3)

game:GetService("Workspace").Sounds.Music.Reflections:Play()

wait(0.5)

script.Parent.Parent.Folder.Done.Disabled = false

TweenService:Create(

allEvents,

TweenInfo.new(2),

{TextTransparency = 0}

):Play()

wait(6)

startCamera.Disabled = false

wait(.5)

TweenService:Create(

allEvents,

TweenInfo.new(2),

{TextTransparency = 1}

):Play()

wait(3.5)

TweenService:Create(

fade,

TweenInfo.new(2),

{BackgroundTransparency = 1}

):Play()

game:GetService("Workspace").Sounds.SFX.VoiceOver:Play()

startCamera.Parent.Subtitles.Disabled = false

wait(86.23)

TweenService:Create(

fade,

TweenInfo.new(2),

{BackgroundTransparency = 0}

):Play()

TweenService:Create(

game:GetService("Workspace").Sounds.SFX.RadioStatic,

TweenInfo.new(2),

{Volume = 0}

):Play()

TweenService:Create(

game:GetService("Workspace").Sounds.Music.Reflections,

TweenInfo.new(2),

{Volume = 0}

):Play()

wait(4)

game:GetService("Workspace").Sounds.Music.Reversible:Play()

TweenService:Create(

chapter1,

TweenInfo.new(1),

{TextTransparency = 0}

):Play()

wait(2)

TweenService:Create(

timeof,

TweenInfo.new(1),

{TextTransparency = 0}

):Play()

wait(2)

TweenService:Create(

literal,

TweenInfo.new(1),

{TextTransparency = 0}

):Play()

wait(4)

TweenService:Create(

literal,

TweenInfo.new(1),

{TextTransparency = 1}

):Play()

TweenService:Create(

timeof,

TweenInfo.new(1),

{TextTransparency = 1}

):Play()

TweenService:Create(

chapter1,

TweenInfo.new(1),

{TextTransparency = 1}

):Play()

game:GetService("Workspace").ServerStuff.Events.MissionsEvents.TimeOfChange.CloneVan.RemoteEvent:FireServer()

wait(1.5)

startCamera.Parent.CameraHandler.Disabled = true

script.Parent.FirstDialogue.Disabled = false

Then the RemoteEvent fires at line 128 and clones the van to the folder in workspace

--stuff

local camera = game.Workspace.CurrentCamera

local Player = game.Players.LocalPlayer

local Character = Player.Character or Player.CharacterAdded:Wait()

local TweenService = game:GetService('TweenService')

local InputService = game:GetService("UserInputService")

local fade = script.Parent.Frame

camera.CameraType = Enum.CameraType.Scriptable

--cameras

local folder = game:GetService("Workspace"):FindFirstChild("CurrentMission"):WaitForChild("Van"):WaitForChild("Cameras")

local BoxesCamera = folder.BoxesCamera

local CameraBack = folder.CameraBack

local CameraBox = folder.CameraBox

local CameraGrass = folder.CameraGrass

local CameraPlayerFront = folder.CameraPlayerFront

local CameraTree = folder.CameraTree

local CameraTruckFront = folder.CameraTruckFront

--Dialogues

local dialogues = script.Parent.TruckDialog

local isThatAll = dialogues.c1 --1

local noTheres = dialogues.p1 --2

local looksLike = dialogues.c2 --3

local inThatCase = dialogues.c3 --4

local callMeWhen = dialogues.c4 --5

local waitWhat = dialogues.p2 --6

local whoWillHelp = dialogues.p3 --7

local imSorrySir = dialogues.c5 --8

local sel1 = dialogues.psel1 --9

local sel2 = dialogues.psel2 --10

--Player Faces

local pAngryFace = game:GetService("Workspace").CurrentMission.Van.Player.Head.FaceAngry

local pBlink = game:GetService("Workspace").CurrentMission.Van.Player.Head.FaceBlink

local pFaceConfused = game:GetService("Workspace").CurrentMission.Van.Player.Head.FaceConfused

local pFaceNormal = game:GetService("Workspace").CurrentMission.Van.Player.Head.FaceNormal

local pFaceSmile = game:GetService("Workspace").CurrentMission.Van.Player.Head.FaceSmile

local pFaceTalk = game:GetService("Workspace").CurrentMission.Van.Player.Head.FaceTalk

--Trucker Faces

local tFaceNormal = game:GetService("Workspace").CurrentMission.Van.Trucker.Head.Normal

local tFaceTalking = game:GetService("Workspace").CurrentMission.Van.Trucker.Head.Talking

--Main Script

wait(1)

camera.CFrame = CameraGrass.CFrame

isThatAll.Visible = true

wait(3)

isThatAll.Visible = false

TweenService:Create(

fade,

TweenInfo.new(1),

{BackgroundTransparency = 1}

):Play()

noTheres.Visible = true

wait(5)

camera.CFrame = CameraTruckFront.CFrame

noTheres.Visible = false

wait(.3)

tFaceNormal.Transparency = 1

tFaceTalking.Transparency = 0 --isSpeaking

looksLike.Visible = true

wait(7)

looksLike.Visible = false

tFaceNormal.Transparency = 1

tFaceNormal.Transparency = 0

wait(.3)

camera.CFrame = CameraBox.CFrame

inThatCase.Visible = true

wait(6)

inThatCase.Visible = false

camera.CFrame = CameraBack.CFrame

wait(0.2)

callMeWhen.Visible = true

wait(4.5)

callMeWhen.Visible = false

camera.CFrame = CameraPlayerFront.CFrame

pFaceNormal.Transparency = 1

pFaceConfused.Transparency = 0

waitWhat.Visible = true

wait(4.5)

waitWhat.Visible = false

camera.CFrame = BoxesCamera.CFrame

whoWillHelp.Visible = true

wait(5.5)

camera.CFrame = CameraTruckFront.CFrame

wait(0.2)

whoWillHelp.Visible = false

wait(0.1)

tFaceNormal.Transparency = 1

tFaceTalking.Transparency = 0

imSorrySir.Visible = true

wait(5.5)

imSorrySir.Visible = false

tFaceNormal.Transparency = 0

tFaceTalking.Transparency = 1

wait(0.3)

camera.CFrame = CameraTree.CFrame

wait(0.3)

sel1.Visible = true

wait(0.5)

sel2.Visible = true

wait(0.3)

sel1.input.Disabled = false

sel2.input.Disabled = false

It runs perfectly in studio, but then on the client it happens:


The “CurrentMission” folder is always at workspace…
image

1 Like

I already tried, but didn’t worked

1 Like

In case if the second script is a ServerScript, LocalPlayer doesn’t work. You need to get the player from the first arg of the remote’s detection. I don’t see the OnServerEvent anywhere. Make sure in the script to check that if the CurrentMissionVan exists in Workspace. My guess is that this is not the full script.

1 Like

It works in studio… the problem is that without I touching this fricking script it says that the “CurrentMission” didn’t exists in workspace while in client. And as I mentioned in the main post, you can see the van in the workspace wayyy before the script brokes.

1 Like

And it wouldn’t make sense to say that something that always was there broke because wasn’t added correctly.

1 Like

Interesting… Please perform the check that if CurrentMissionVan exists tho.

Did you send the whole script? I don’t think so as I don’t see the OnServerEvent anywhere.

1 Like

…it always was there and never was removed.

1 Like

I can see it but please perform the check. Sometimes there are issues that occur with FindFirstChild and checking if the property/whatever exists and then performing the function. Is the CurrentMissionVan supposed to be at Workspace or the in folder?

1 Like

How I could check if it only brokes in-game?

In the function, before completing it. Check if CurrentMissionVan exists in Workspace and then continue if it exists. Is the CurrentMissionVan supposed to be at Workspace or the in folder? Also where does your LocalScript exist?

The name is not “currentMissionVan” the client names it like that… that’s what I’m saying, this makes no sense. Also the script is located in playergui

Is it a LocalScript or a ServerScript? You can detect what the client changes it into. Check in the script if it exists. Can you send me the full script?

Do you have Discord?

1 Like

It’s a local script. Going to check it now

“CurrentMission” exists, but in logs the client says that “CurrentMissionVan” does not… I’ve never named it like that… I’m almos giving up

Please send me the full script. I am a 100% sure that you didn’t send the whole script.

Certain things don’t replicate between server and the client.

I send the full scripts… They both are local scripts in the player gui. I clone the van using a fireserver:

The problem is I don’t see your serverscript detection of FireServer which is supposed to be detected by OnServerEvent.