XoXFaby

Untitled

Sep 8th, 2014
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1.  
  2. local coinmat = Material("fabycoin/coin.png")
  3. local lastcoins = 0
  4. local coinanim = false
  5. local coinanimi = 0
  6. local coinanimdiff = 0
  7.  
  8. local CoinTextX = 25
  9. local CoinTextY = 13
  10. local CoinTextSize = 12
  11.  
  12. local CoinPicX = 5
  13. local CoinPicY = 5
  14. local CoinPicWidth = 16
  15. local CoinPicHeight = 16
  16.  
  17. surface.CreateFont("CoinFont", {font = "bebas", size = CoinTextSize, weight = 0})
  18.  
  19. hook.Add("HUDPaint", "FabyCoin", function()
  20.  
  21. surface.SetMaterial( coinmat )
  22. surface.SetDrawColor( Color(255, 255, 255, 255 ) )
  23. surface.DrawTexturedRect(CoinPicX ,CoinPicY ,CoinPicWidth ,CoinPicHeight )
  24.  
  25. if lastcoins != LocalPlayer():PS_GetPoints() then
  26. coinanim = true
  27. coinanimi = 0
  28. coinanimdiff = LocalPlayer():PS_GetPoints() - lastcoins
  29. end
  30.  
  31. if coinanim then
  32. cointext = math.floor( ( LocalPlayer():PS_GetPoints() - coinanimdiff ) + ( coinanimdiff * ( coinanimi / 100 ) ) )
  33. coinanimi = coinanimi + 10
  34. else
  35. cointext = LocalPlayer():PS_GetPoints()
  36. end
  37. cointext = string.reverse(cointext):gsub('(%d%d%d)','%1,'):reverse()
  38. if string.sub(cointext,1,1) == "," then
  39. cointext = string.sub(cointext,2, string.len(cointext) )
  40. end
  41.  
  42. draw.SimpleTextOutlined( cointext , "CoinFont", CoinTextX , CoinTextY , Color(255, 255, 255), 0, 1, 1, Color(0, 0, 0) )
  43.  
  44. if coinanimi >= 100 then
  45. coinanim = false
  46. end
  47.  
  48. lastcoins = LocalPlayer():PS_GetPoints()
  49. end)
Advertisement
Add Comment
Please, Sign In to add comment