For example, i would get a block, and lets say you want 1 point. It changes your leaderstats into "1." Lets say ive decided 50 instead; instead of me having 51, it would change from 1 to 50.
local function ChangeCash(player,amount) -- Create function if player ~= nil and amount ~= nil then -- if player and cash exist then player.leaderstats.Cash.Value = amount -- set players cash to amount change player.leaderstats.Cash to what/wherever your cash is stored. end end --You can then set a players cash using ChangeCash(player,50). However you get player is up to you, but I've provided a very basic example below. script.Parent.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then ChangeCash(game.Players:FindFirstChild(hit.Parent.Name),50) end end)
Closed as Not Constructive by Ziffixture
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?