Hello, while testing one of my projects and looking through the developer console, I noticed that a script appeared to work in studio, but not ingame, printing this error message :
The error message is talking about this part of the script :
function newWave()
if allowNextWave == true then
if wave > #script:GetChildren() then
wave = 1
else
wave = wave + 1
end
shared.WaveNotif(wave)
local sound = Instance.new("Sound",workspace)
sound.SoundId = "rbxassetid://5980011923"
sound.Volume = 3
sound:Play()
spawnEnemy(require(script[wave]))
debris:AddItem(sound,10)
end
end
The script is meant to be a zombie wave script, but it affects specifically this line :
shared.WaveNotif(wave)
It only affects this line, the conditional branch above it remains unaffected. I’ve tried turning the “wave” value into a NumberValue instance but that didn’t work either. Can anybody atleast give me an idea of what’s happening?