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?
