Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

[SOLVED] How do I add currency when a block disappears?

Lets say a part gets destroyed which means it disappears.

Then after it disappears it will reward the player a certain amount of currency.

amount = 1

(SCRIPT FINDING IF IT IS DESTROYED?)

v.leaderstats[currencyname].Value = v.leaderstats[currencyname].Value + amount

1 comment

0

you can use :FindFirstChild(that part) to see if it exists or not

2 answers

you can use :FindFirstChild(that part) to see if it exists or notstarmaq 1269 — 8mo

answer is here ^

game.Players.PlayerAdded:connect(function(plr)
local plrleader = plr.leaderstats.CURRENCYNAME.Value
game.Workspace.Part:Remove()
plrleader = plrleader + 5
end)

1 comment

0

-1 for not explaining, using deprecated features, and giving code that doesn't even work.

This discussion is preserved as it was. New answers, comments, and votes are closed.