basically the parent clones into workspace and clicking it should buy it
game.Players.PlayerAdded:Connect(function(plr) Money = plr.leaderstats.Money script.Parent.ClickDetector.MouseClick:Connect(function() if Money.Value < 30 then print('not enough money') else Money.Value = Money.Value - 30 script.Parent:Destroy() end end) end)
You're doing something wrong, other people can click the brick and use your OWN money, so instead of doing that you just add a single event.
script.Parent.ClickDetector.MouseClick:Connect(function(plr) if not plr then return end -- End the function if there's no player Money = plr.leaderstats.Money if Money.Value < 30 then print('not enough money') else Money.Value = Money.Value - 30 script.Parent:Destroy() end end)
Done! Now you listen with one connection instead of more, and now it only does it to the player that clicked it! If this helped mark this as the answer!