Hello, I have come across with an issue while attempting to change a value to the Amount of Enemies in a folder
This Error keeps appearing when I attempt this: Players.Altomegaflowey844.PlayerGui.Wave_Enemies.Counting:13: attempt to get length of a Instance value
Here is the code of the counter:
--// Variables
local Rep = game:GetService("ReplicatedStorage")
local WaveText = Rep.GamePlayFiles.WaveText.Value
local EnemiesValue = Rep.GamePlayFiles.Enemies
local WaveLabel = script.Parent.Wave
local EnemiesText = script.Parent.Enemies
local EnemiesFolder = workspace.Enemies
--// Counting Enemies
while true do
wait()
for i, enemies in pairs(EnemiesFolder:GetChildren()) do
EnemiesValue.Value = #enemies
end
end
Any help is appreciated!