SavDevv
(Sav)
January 29, 2021, 1:58pm
#1
hi ive been trying to make it so when someone buys something it removes a certain bit of ingame money here is the script
game.Workspace.Part.ProximityPrompt.Triggered:Connect(function(player)
if player.leaderstats.Cash.Value >= 0.15 then player.leaderstats.Cash.Value = player.leaderstats.Cash.Value - 0.15
end
end)
1 Like
RainSurv
(Rain)
December 13, 2022, 1:03pm
#2
make a remote event for when it removes their cash
you can also look at this, it has a solution similar to yours
Use a remote event for it. Create a remote event in ReplicatedStorage named TakeCash
code on server script:
game.ReplicatedStorage.TakeCash.OnServerEvent:Connect(function(player)
if player.leaderstats.Cash.Value >= 1250 then
player.leaderstats.Cash.Value -= 1250
end
end)
code in a local script:
local debounce = false
script.Parent.MouseButton1Click:Connect(function()
if not debounce then
debounce = true
game.ReplicatedStorage.TakeCash:FireServer()
…
DasKairo
(Cairo)
December 13, 2022, 3:33pm
#3
Not sure if its a good idea to reply on a 2 year old Topic
3 Likes
RainSurv
(Rain)
December 17, 2022, 4:26pm
#4
it doesn’t matter if it’s old or not, someone could face the same issue. no replies were given, and I could have helped someone
2 Likes