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

help with making a "functional" round system?

Asked by 5 years ago

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?

0
Hints are deprecated, but i suggest not waiting every 0.0299999988... seconds to do that code User#24403 69 — 5y
0
its supposed to disable itself after running once, the disabled checkbox was checked but it would still continue to run. also, the hints run fine, but would they cause any problems because of being depreciated? mantorok4866 201 — 5y
1
No but they should not be used in new work. Deprecated means roblox no longer supports something, and they can be removed at any time, and if for example an update accidentally broke hints they're most likely not gonna fix it. User#24403 69 — 5y
0
so what should I use instead? I dont want to make a screengui just to tell everyone who won the round, and what should I do about the round system? my game is almost done I just need to get that part of it working. mantorok4866 201 — 5y

Answer this question