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

FireServer without 'cloning' script?

Asked by 5 years ago

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.

1 answer

Log in to vote
0
Answered by
Audiimo 105
5 years ago
Edited 5 years ago

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

0
You are completely missing the point of the question. You partially answered it when you said 'there is no way to stop it from coling, or so I believe' but the work-around is competely off and does not fix the problem fa_QURobloxXD 29 — 5y
0
Ok Audiimo 105 — 5y
Ad

Answer this question