Very perplexing issue for me, but likely just my missing fundamentals of scripting:
The script is quite long, and I don’t think posting all of it is necessary to highlight my issue, but I can post more if needed.
I have a very long function called TrueUp that reconciles my game after each round of a player placing a part. All of this works fine. After nearly all times TrueUp is called it will reach the end, fire back to the client and they can place the next part. This happens until the player isn’t doing well and places a part such that the game should be over, in which case elements of TrueUp will set a local variable ‘GameOver’ to true, which changes a value ‘WinLossStatus’ and ends the game.
All of the code works fine and the game functions, but my question is this. When GameOver is true, the value “WinLossStatus” is being set to “Loss” as many times as TrueUp was called. This doesn’t make sense as I can see that my test prints only run a single time, it is the line(s) of code sandwiched between them that are running multiple times. How is this possible? (that the prints run once but code between them multiple times?)
if GameOver == true then
if Set == workspace.Set09 then
print("Test 1")
if workspace.Set09.WinLossStatus.Value == "" then
print("Test 2")
workspace.Set09.WinLossStatus.Value = "Loss"
print("Test 3")
workspace.Set10.WinLossStatus.Value = "Win"
print("Test 4")
end
Again, I know I’m not giving the full picture, but hoping someone might have thoughts on what could cause this?
Thanks!
