I am working on a car spawner script that works well except for 1 thing..... The money is given back after the purchase any clue? here is the local script:
script.Parent.MouseButton1Click:Connect(function() if script.Parent.Parent.Purchased.Value == true then game.ReplicatedStorage.SpawnCar:FireServer(script.Parent.Parent.Name) else local PriceOfItem = game.ReplicatedStorage:WaitForChild("CheckPrice"):InvokeServer(script.Parent.Parent.Name) if game.Players.LocalPlayer.leaderstats.Cash.Value >= PriceOfItem and script.Parent.Parent.Purchased.Value == false then game.Players.LocalPlayer.leaderstats.Cash.Value = game.Players.LocalPlayer.leaderstats.Cash.Value - PriceOfItem script.Parent.Parent.Purchased.Value = true end end end)