Guest User

coin clicked

a guest
May 5th, 2019
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. local tool = script.Parent
  2.  
  3. local Settings = tool:WaitForChild("Settings")
  4. local Strength = Settings.Strength
  5.  
  6. local Player = game.Players.LocalPlayer
  7. local PlayerUI = Player:WaitForChild("PlayerGui").PlayerUI
  8.  
  9. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  10. local RemoteEvents = ReplicatedStorage:WaitForChild("RemoteEvents")
  11. local CoinClicked = RemoteEvents.CoinClicked
  12.  
  13. local Debounce = false
  14.  
  15. tool.Activated:Connect(function()
  16. if Player.leaderstats.HiddenValues.CurrentValue.Value < Player.leaderstats.Storage.Value then
  17. if Debounce == false then
  18. Debounce = true
  19. CoinClicked:FireServer(Strength.Value)
  20. wait()
  21. Debounce = false
  22. end
  23. else
  24. if PlayerUI.StorageFull.Visible == false then
  25. if Debounce == false then
  26. Debounce = true
  27. PlayerUI.StorageFull.Visible = true
  28. wait(.5)
  29. Debounce = false
  30. end
  31. end
  32. end
  33. end)
Advertisement
Add Comment
Please, Sign In to add comment