I can’t figure out what is going on here, I have a prox. prompt that triggers the minigame that the player wishes to play (mainly gui based). It calls the relevant module script as passed through the remote. However, when the player returns to the same minigame it’s as if the module is duplicated (remotes inside the module are firing multiple times depending on how many times the player has returned to the minigame)
RemoteMinigamer.OnClientEvent:Connect(function(minigame, value)
if questing == false and minigaming == false and equipped == false then
minigaming = true
local minigameModule = require(ReplicatedStorage.Minigames[minigame]:Clone())
minigameModule(player, value)
return
else
return print ("Player already has a minigame running")
end
end)
That probably happens because of old connection stacking, you should add a connection cleanup logic after player leaves the minigame instead of cloning the module.
I see, can you try adding various print statements at every important part to see where it is actually firing twice? This would just help us narrow down the bugged point.
Just tested, every function is firing twice, to me it seems like the module script is being held in cache and not closed out, so when the module is called again it’s duplicated. I even tried :Destroy() when the return value is fired (since I tried cloning the module in the first require anyway) and it still runs double/triple+