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

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

Asked by 4 years ago
Edited 3 years ago

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

0
you can use `:FindFirstChild(that part)` to see if it exists or not starmaq 1290 — 4y

2 answers

Log in to vote
0
Answered by 3 years ago

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

answer is here ^

Ad
Log in to vote
-1
Answered by
Robowon1 323 Moderation Voter
4 years ago
game.Players.PlayerAdded:connect(function(plr)
local plrleader = plr.leaderstats.CURRENCYNAME.Value
game.Workspace.Part:Remove()
plrleader = plrleader + 5
end)
0
-1 for not explaining, using deprecated features, and giving code that doesn't even work. programmerHere 371 — 4y

Answer this question