Sup! I am trying to make a sword that gives cash when you defeat an enemy, but I don’t know how to.
I have made a folder containing a script in ServerscriptService:
game.Players.PlayerAdded:Connect(function(plr)
local leaderstats = Instance.new("Folder", plr)
leaderstats.Name = "leaderstats"
local Cash = Instance.new("IntValue", leaderstats) -- Create a score variable
Cash.Name = "Cash" -- Name
Cash.Value = 150 -- Initial Value
game.StarterGui.BasicUI.Money.Text = Cash.Value .. "$"
end)
now how do i accomplish this??