The script changes the BoolValue to true but the onChanged doesn't detect the change, what am I doing wrong?
local seconds = 9 while not script.Parent.Parent.spawned.Value do wait(1) seconds = seconds - 1 script.Parent.Parent.GuiPart.BillboardGui.Frame.TextLabel.Text = seconds if seconds == 0 then script.Parent.Parent.spawned.Value = true end end local function onChanged(NewValue) print(NewValue) if script.Parent.Parent.spawned.Value == true then script.Parent.Parent.spawned.Value = false local crateModel = Instance.new("Model") crateModel.Parent = workspace local spawnBase = script.Parent local crates = game.ServerStorage.Crates.T4Crates:GetChildren() local randomCrate = crates[math.random(1, #crates)] local pos = Vector3.new(math.random(-spawnBase.Size.x/2, spawnBase.Size.x/2), spawnBase.Size.y/2, Vector3.new(spawnBase.Size.Y+10), math.random(-spawnBase.Size.z/2,spawnBase.Size.z/2)) local rotation = randomCrate:SetPrimaryPartCFrame(spawnBase.CFrame * CFrame.new(pos)) randomCrate.Handle.BodyForce = Vector3.new(0, randomCrate.Handle:GetMass()* 196.2, 0) end end script.Parent.Parent.spawned.Changed:Connect(onChanged)