Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

This won't create a clone nor will it remove money?

Asked by 5 years ago

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?

Answer this question