I can seem to figure this out, this is all under a while true do script and no matter how I write it I always get the same problem.
When I fire all clients it only works on the first loop, but when it goes to replay the game and gets down to RT == 0 it changes all the values to everything and prints everything doesn’t print any errors but doesn’t replay the FireAllClients… please help… this is my main loop needed for my game…
I added a wait for activated games so the whole true do script only plays when activated games is true thinking I was just exhausting the scripts but still no solution.
Yeah at the top of the loop when I Fire (start) I bring the round time back up too 120 then the round time counts back down to 0 when it hits 0 it prints everything correctly and acts like it’s working but for some reason will on fire the “End” event once.
maybe add some more print checkpoints, one right before and after the end event firing. Maybe one in the local script where the event is firing. Print checkpoints will help find where the issue is
if you were to change RT.Value == into RT.Value <= it would work, in the code after the round ends you set RT.Value to negative one, and == means given value must be like the other value,
you can solve this by changing RT.Value = -1 into 0 or changing RT.Value == 0 into RT.Value <= 0
This is already in the top of the loop changing it back to 35 at the start of the new loop so the -1 shouldn’t be changing it, the reason I have it set to -1 is so when the loop starts it doesn’t start with a round time of 0 causing the round to automatically end.
why is there a loop in the first place? I’ve made round games before and I’ve never needed to use a loop when ending a game (or I just end the game from the server)
It was set up that way because I didn’t originally write the script for them I’m trying to fix the game, and I re wrote everything to basically play on this loop. I mean if you would write the beginning differently then by all means. I just want this to play every single time the activated games value is true. Without failing, it was just a looped script to make the game continuously run but it doesn’t need to be.
Again fixing the code for someone else, I didn’t write the code from the ground up, otherwise this would be split up into many different scripts to simplify however. This one script is already firing and doing a lot of events so re working it is way beyond rn.
@Fire_Scout makes a great point, this code is a bit difficult to debug. I understand that you are unable to rewrite the code, but I do recommend cleaning up the code
I would agree if the script was actually breaking but it isn’t, nor is the loop actually failing anything now, besides the game.ReplicatedStorage.Winner.Entity.Value = true that’s the only thing the script isn’t doing that’s making it not fire the End event. If there is a way that I could bypass this make it call for the winner value true when round time hits 0 then it would work.