So basically what happens is that when the player clicks on a part. The part then gets destroyed. I then use a for i loop to lerp the object to another transparent object and I am unsure how to save this. So that the player doesn't have to start the tycoon all over again.
Here is the code:
game.workspace.Box.BA:WaitForChild("B1Buy").ClickDetector.MouseClick:Connect(function(player)
if (player.leaderstats.Cahs.Value - 50) >= 0 then
local B1 = game.Workspace.B1
local B1Trans = game.Workspace.Box.BA.B1Transfer
player.leaderstats.Cash.Value = player.leaderstats.Cash.Value - 50
game.Workspace.Box.BA.B1Buy:Destroy()
SoundCraft:Play
for i = 0,1,0.01 do
wait()
B1.CFrame = B1.CFrame:Lerp(B1Trans.CFrame,1)
B1.Transparency = B1.Transparency - 0.01
end
B1.CanCollide = true
end
end)

1 comment
Here is the code: