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

regen script that take your money wont work?

Asked by 3 years ago

what im trying to do is making a regen script that takes away your money before it regens the part/model here is the script i made

location = script.Parent.Parent.Parent regen = script.Parent.Parent save = regen:clone() local price = 5 -- The price of your item. local db = true script.Parent.ClickDetector.MouseClick:connect(function(player) if player.leaderstats.Cash.Value >= price then player.leaderstats.Cash.Value = player.leaderstats.Cash.Value - price db = false

function onClicked() regen:remove() local back = save:clone() back.Parent = location back:MakeJoints() db = true end

script.Parent.ClickDetector.MouseClick:connect(onClicked)

it may be absolutely wrong but im also a beginner

0
What part of it does not work, if it gives an error what does it say Trongaming3211 7 — 3y

Answer this question