Server Script:
local DataStore2 = require(game.ServerScriptService.DataStore.MainModule)
game:GetService('Players').PlayerAdded:Connect(function(player)
local walletStore = DataStore2("Wallet",player)
local amountInWallet = walletStore:Get(20)
player.CharacterAdded:Connect(function(character)
character:WaitForChild("Humanoid").Died:Connect(function()
print(player.." has died!")
if amountInWallet then
local torpos = character.Torso.CFrame
local moneystack = game.ReplicatedStorage.MeshPart:Clone()
moneystack.BillboardGui.MoneyAmount = amountInWallet
moneystack.BillboardGui.Amount.Text = "$ "..amountInWallet
moneystack.CFrame = torpos
moneystack.Parent = workspace
walletStore:Set(0)
end
end)
end)
end)
It won't drop any money, and it doesn't print, anyone know why?
