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

How can i fix this error, i can't print out the "game.Lighting" size, how can i fix it ?

Asked by 3 years ago
Edited 3 years ago

Im making a game and trying to check the game.Lighting size, i use :game.Lighting:GetChildren()" then print(#game.Lighting:GetChildren()) but it says this error, here's the error:

  ServerScriptService.Script:35: attempt to get length of a Instance value

also, i used an Instance.new('BoolValue") and set the parent to :game.Lighting" by script, is that where the error start? Someone help me fix it please

1 answer

Log in to vote
0
Answered by 3 years ago

Not completely sure what you're doing, but I'm pretty sure it's...

print(#game.Lighting:GetChildren()) 

You're getting the the length of the Lighting instead of its Children

0
yes, im getting its length O.o ninjaty2003 8 — 3y
0
i really sorry about the thing that i typed wrong the code, it must be print(game.Lighting:GetChidlren()), but it prints out the error ninjaty2003 8 — 3y
0
thank you very much for uploaded this answer but i think i solved it ._. ninjaty2003 8 — 3y
Ad

Answer this question