I need to make a round based system, the way I make them is have scripts in serverscriptservice do something, enable the next script and then disable themselves, Im having severe issues, some of the scripts continue to run even If I delete the script responsible, I even tried using debounce but debounce wont work either. heres one script as an example:
while true do wait() local Bvalue = game.ReplicatedStorage.Bcorehealth local Rvalue = game.ReplicatedStorage.Rcorehealth local debounce = false if Bvalue.Value <= 0 and game.ReplicatedStorage.Permission2.Value == false then game.ReplicatedStorage.Permission2.Value = true local msg = Instance.new("Hint") msg.Parent = game.Workspace msg.Text = "blue teams core has been destroyed! red wins!" wait(5) msg:Destroy() game.Workspace.CurrentMap:Destroy() game.Workspace.TeamReset.Enabled = true wait(3) game.Workspace.TeamReset.Enabled = false game.ReplicatedStorage.Permission.Value = false game.ServerScriptService.Masterscripts.IntermissionScript.Disabled = false wait(0.1) script.Disabled = true end if Rvalue.Value <= 0 and game.ReplicatedStorage.Permission2.Value == false then game.ReplicatedStorage.Permission2.Value = true local msg = Instance.new("Hint") msg.Parent = game.Workspace msg.Text = "red teams core has been destroyed! blue wins!" wait(5) msg:Destroy() game.Workspace.CurrentMap:Destroy() game.Workspace.TeamReset.Enabled = true wait(3) game.Workspace.TeamReset.Enabled = false game.ReplicatedStorage.Permission.Value = false wait(0.1) script.Disabled = true end end
I tried putting a boolvalue inside replicated storage so that this script cant run if the value is true, after testing the script still ran regardless of what the value said.
Im not very happy with how this is going so can someone please help me with a cleaner and more efficient round system?