Advertisement
Guest User

Untitled

a guest
Feb 19th, 2020
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. local Player = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent
  2. local Stats = Player:WaitForChild("Stats")
  3. local Coins = Stats:WaitForChild("Coins")
  4. local DNA = Stats:WaitForChild("DNA")
  5. local StrengthMax = Stats:WaitForChild("StrengthMax")
  6.  
  7. script.Parent.Parent.MouseButton1Click:Connect(function()
  8. local Settings = require(game.ReplicatedStorage:WaitForChild("DNA"))
  9. if Coins.Value >= Settings[script.Parent.Value]["Cost"] then
  10. if script.Parent.Parent.TheTextFromBuy.Text == "Buy" then
  11. StrengthMax.Value = Settings[script.Parent.Value]["Space"]
  12. Coins.Value = Coins.Value - Settings[script.Parent.Value]["Cost"]
  13. DNA.Value = Settings[script.Parent.Value]["This"] +1
  14. end
  15. end
  16. end)
  17.  
  18.  
  19. while true do
  20. wait()
  21. if DNA.Value > script.Parent.Value then
  22. wait()
  23. script.Parent.Parent.TheTextFromBuy.Text = "Owned"
  24. else
  25. wait()
  26. script.Parent.Parent.TheTextFromBuy.Text = "Buy"
  27. end
  28. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement