-
What do you want to achieve? I want to add a second event to a function
-
What is the issue? I’m not sure if I can or how
-
What solutions have you tried so far? I looked online
--
game.Players.PlayerAdded:Connect(function(player)
local cashdatastore = ds2("cashv1",player)
local leveldatastore = ds2("levelv1",player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
local cash = Instance.new("IntValue")
local level = Instance.new("IntValue")
cash.Value = 0
cash.Name = "Cash"
level.Value = 0
level.Name = "Level"
level.Parent = leaderstats
cash.Parent = leaderstats
leaderstats.Parent = player
local function updatedata(updatedvalue)
cash.Value = cashdatastore:Get(updatedvalue)
level.Value = leveldatastore:Get(updatedvalue)
end
updatedata()
cashdatastore:OnUpdate(updatedata())
end)