Hi,
I’ve been trying to script an airlock sequence, and I’ve been having trouble with an error. When I try to run my script, I keep getting the error “LightStrip is not a valid model of Workspace.Basement.Doors.ServerRoomDoor” I’ve tried rewriting the line in question and renaming the light strip, but nothing seems fix the error. Is there a possible fix for this?
Screenshots attached below.
Its possible that the light strip is falling into the void and deleting it,
Ensure that it is anchored, and if it can be, make it CanCollide True
Anchored and CanCollide are both true.
First, maybe change the line to
game.Workspace.Basement.Doors.ServerRoomDoor.LightStrip.BrickColor = BrickColor.new(255, 000, 000)
(forgot .BrickColor)
then add some code right before the line that gives the error to debug the problem:
print(game.Workspace.Basement.Doors.ServerRoom.Door:GetChildren())
If LightStrip isn’t in the children, it’s being removed (or it hasn’t replicated yet).
If this is on the client it might also be that it hasn’t replicated yet. In that case use WaitForChild("LightStrip")
instead of .LightStrip
.
You can also use breakpoints and the explorer to debug.
2 Likes
Thank you, the WaitForChild seemed to fix it.
1 Like