local gold = {} playerData = {} local dataStoreService = game:GetService("DataStoreService") local playerDataStore = dataStoreService:GetDataStore("PlayerDataStoreTest3") function gold.awardGold(player, goldGiven) if player and goldGiven then local myData = playerDataStore:GetAsync(player.userId) or {} playerData[player.userId] = myData if myData then myData.gold = myData.gold + goldGiven local goldValue = player.PlayerFolder:WaitForChild("Gold") if goldValue then goldValue.Value = myData.gold end end end end return gold
Here I have my module which gives gold to players, and it works, but I cant call it again. How do I call it multiple times?
Why would you need to call it multiple times? You only need to require a module once in one script? If required again it would be in another script, unless you were wanting to refresh some form of information in the processing of your code.
local module = require(module) module.awardGold(plr, 10) module.awardGold(plr, 10)