while wait() do
if minutesVal.Value == 0 and secondsVal.Value == 0 then
bought.Value = false
game.ReplicatedStorage.ShopEvents.ClaimedFolder.Claimed:FireServer()
break
end
end
I would also recommend adding a print("text") after the if statement to check if the event is not firing, or the values are not correct.
in that case i’d reccomend merging the two scripts using a remotevent fired by the server to connect the two instead of a remoteEvent insecurely being fired from the client, possibly ruining the game by cheaters fireing the RemoteEvent.
removing this loop will also help upgrade the game’s performance.
RemoteEvent.OnClientEvent:Connect(function(Value)
---------whatever you want to change clientsided-----------
end)
If it is visible from the servers’s perspective, then you can change it from there, though this does imply that the server know’s what player to change. if you want it to change it on every client you can just make a for loop looping through all of the players and changing the value there.
local children = game.Players:GetChildren()
for i = 1,#children do
children[i]-----------change the value here.------------
end