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

Event only sometimes fires?

Asked by 4 years ago

Script 1:

local DSS = game:GetService("DataStoreService"):GetDataStore("WinsSave")
local Matchtime = Instance.new("IntValue", workspace)
Matchtime.Name = "Matchtime"
Matchtime.Value = 1
game.ReplicatedStorage.MatchBegan:Fire(Matchtime)

Script 2:

game.ReplicatedStorage.MatchBegan.Event:Connect(function(Matchtime)
    Matchtime.Value = 30
    while Matchtime.Value > 0 do
        wait(1)
        Matchtime.Value = Matchtime.Value - 1
    end
    print("Let the games begin")
end)

The event will sometimes fire, and sometimes not. I've tried adding waits and waitforchild commands, but nothing seems to fix this issue.

Answer this question