I have this code where if a prompt is triggered, it will award the player one win which will go to their leaderstats. After some testing, I’ve come to realize that if multiple people coincidentally trigger the prompt at the exact same time, it only awards one random player who triggered it and nobody else gets a win. Is there a way I can just make the function that awards points fire whenever a player triggers it at any time instead firing only when the function is complete?
Code:
prompt.Triggered:Connect(function(player)
if not debounce then
debounce = true
local winval = player.leaderstats:FindFirstChild("Wins")
if multiply == true then
winval.Value = winval.Value + 2
else
winval.Value = winval.Value + 1
end
wait()
debounce = false
end
end)
I can send the entire code if needed but I’ve pasted the only necessary part.
Ok so trying this out, it solves the overlapping thing. However, it sparks a new issue. Basically, I have a gamepass for this which doubles the amount of wins when pressed. When a player that doesn’t own the gamepass presses it, it goes up by 1. However, when a player who owns the gamepass joins the server. The player without the gamepass somehow inherits the multiplier and also starts earning 2x the points despite not owning gamepass.