Advertisement
Guest User

Untitled

a guest
Apr 24th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. local Player = game.Players.LocalPlayer
  2. local Character = Player.Character
  3. local Mouse = Player:GetMouse()
  4.  
  5. script.Parent.Equipped:connect(function()
  6. local magnitude = (Character.HumanoidRootPart.Position - workspace.NexoBlue.Position).magnitude
  7. amount = 1
  8. currencyname = "Iron"
  9.  
  10. debounce = false
  11.  
  12. Mouse.Button1Down:connect(function()
  13. local health = game.ReplicatedStorage.Health
  14. local target = Mouse.Target
  15. if target then
  16. if magnitude <= 8 then
  17. if not debounce then
  18. debounce = true
  19. print('-1 de vida al nexo Blue')
  20. health.Value = health.Value - 1
  21. if health.Value > 0 then
  22. for i,v in pairs(game.Players:GetPlayers())do
  23. if v:FindFirstChild("leaderstats")and v then
  24. v.leaderstats[currencyname].Value = v.leaderstats[currencyname].Value + amount
  25. if target.Name == "NexoBlue" then
  26. for i = 0,1,0.1 do
  27. target.Transparency = i
  28. target.Decal1.Transparency = i
  29. target.Decal2.Transparency = i
  30. target.Decal3.Transparency = i
  31. target.Decal4.Transparency = i
  32. target.Decal5.Transparency = i
  33. target.Decal6.Transparency = i
  34. wait()
  35. end
  36. end
  37. end
  38. end
  39. wait(0.001)
  40. debounce = false
  41. target.Transparency = 0
  42. target.Decal1.Transparency = 0
  43. target.Decal2.Transparency = 0
  44. target.Decal3.Transparency = 0
  45. target.Decal4.Transparency = 0
  46. target.Decal5.Transparency = 0
  47. target.Decal6.Transparency = 0
  48. end
  49. else
  50. print("Your are too far from ur destination")
  51. end
  52. end
  53. end
  54. end)
  55. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement