I've noticed that every time you use FireServer at an OnServerEvent in the same script, Studio seems to duplicate the Script and run them separately. I am trying to start a timer and end the timer using the same Remote. I know I can make 2 Remotes and change a variable that breaks out of the while loop but I was thinking this is too cumbersome and was wondering if there was a better way
Code:
--remote is a RemoteEvent remote.OnServerEvent:Connect(function(plr,hasball) while hasball == true do --manipulate a Dictionary end end)
So, when I fire the EventListener for the first time, it will go into the while loop using wait() as a timer. I want to fire it again to stop the while loop.
When you are using RemoteEvent or Functions it is good practice to use two scripts. There is no way to stop it from cloning, or so I believe, but you can add the receiving portion into another script that in the same location as the sending script. I have done this and it works well. Though if they are the same script you'll need a passer script thats the opposite of the two scripts you are using. So if you are using server scripts you'll need to send to a local that sends to the other server script