Help with Script Functions

Kills = nil
NumberKills = nil
QuestDummy = nil

QuestRequestEvent.OnClientEvent:Connect(function(player, )
kils = 0
NumberKills = math.random(1,100)
QuestDummy = "Kill Zombies"
end)

the variables in this script will be changed when a remote event is triggered, I was wondering when changing these variables with a function called by a remote event, will they be the same for other players that call the function?

Since this is server sided, it would be the same for all; depending on how you call it. If each player is supposed to change the variable, make sure that you use an incremental system such as kills = kills+1. Also noticed a typo, it is ‘kills’ and not ‘kils’ in the OnClientEvent function. :slight_smile:

if the player Fire a RemoteEvent without the function finished, will the function be disconnected and start another one?

The function shouldn’t take even a second to run, since Lua (and all other programming languages) is fast.

yes, but i’m creating a script that when the function fires it will be able to fire functions inside

Your callback function does not yield, so no other code can run before the callback completes. You do not need to worry about race conditions if you don’t yield.