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

Why won't the boss spawn at 18:00 and get deleted at 6:00?

Asked by 4 years ago

I'm trying to make the game so at 18:00 the boss will spawn, and at 6:00 it will get deleted, but instead of doing that, it spawns when the game starts (the starting time is 12:00:00) the boss spawns and never gets deleted, how would i fix this?

local debounce = false
game.Lighting:GetPropertyChangedSignal("ClockTime"):Connect(function()
if game.Lighting:GetMinutesAfterMidnight(1080) then
  if debounce == false then
    debounce = true
    local clone = game.ServerStorage.MAN:Clone()
    clone.Parent = game.Workspace.MANSOLDIERS
  end
elseif game.Lighting:GetMinutesAfterMidnight(360) then
  if debounce == true then
    game.Workspace.MANSOLDIERS.MAN:Destroy()
    debounce = false
    end
  end
end)

Answer this question