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

I Have Renamed The Cash Name On My Game, Does This Effect The Script Down below?

Asked by 5 years ago
Edited 5 years ago

Hello As I Said In My Title I Renamed The Cash Name And This Script I Have Put In Is Not Working So Any Help Would Be Great. Also The Name Of The Cash Is JCoins

if productId == (Insert Here) then local cashmoney = game.ServerStorage.PlayerMoney:FindFirstChild(player.Name) if cashmoney then cashmoney.Value = cashmoney.Value + 100 end

0
That code alone doesn't even work. User#6546 35 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago
local PlayerMoney = game.ServerStorage.PlayerMoney

if productId == (Insert Here) then
    local cashmoney = PlayerMoney:FindFirstChild(player.Name)
    if cashmoney then
        cashmoney.Value = cashmoney.Value + 100
    end
end

If you changed the name of the money model or whatever it is, then replace the "PlayerMoney" part at the end of line 1 to it's new name

Ad

Answer this question