Alright, let me put this in a short explanation.
I’m attempting to make an area loading system, where if you go into a certain brick, it loads another area and deloads the previous, could anyone please help me fix this?
19:55:57.478 Workspace.UnanimatedProto.LocalScript:29: attempt to index nil with 'Parent' - Client - LocalScript:29
19:55:57.478 Stack Begin - Studio
19:55:57.478 Script 'Workspace.UnanimatedProto.LocalScript', Line 29 - Studio - LocalScript:29
19:55:57.478 Stack End - Studio
Images of both server and client scripts:
Some more context: The Zone Values are STRINGVALUES, i do not know if i’m doing it wrong, it’d be nice to know!!
Update: Although a little buggy, i managed to do it. I just rewrote the scripts but the solution helped! Thanks @Friendly4Crafter!
Try making it say “game.workspace” instead of “workspace”
cause workspace just looks sloppy, and it could make the script function as intended.
The issue with your script is that
ZoneStorage:FindFirstChild(Zone) is nil. In this case, it means it simply hasn’t loaded yet. Whenever you use
FindFirstChild() on an object that hasn’t loaded yet, it returns nil, however,
WaitForChild() waits for the object to load, avoiding the error. Especially since you are accessing ReplicatedStorage where instances might need to load, try replacing
WaitForChild and see how that goes.
@EatingDoritosRNN the usage of
workspace is not the cause of this error.
game.Workspace can be used interchangeably on the server without an error.
I will attempt this! Seems very promising.