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.
COMMUNITY QUESTION
How do i make it so that when i step on a block, it changes my leaderstat to a dif #?
1 answer
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)
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Eh