Guest User

script

a guest
May 21st, 2020
15
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.46 KB | None | 0 0
  1. local plr = game.Players.LocalPlayer
  2. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  3. local GameItems = ReplicatedStorage:WaitForChild("GameItems")
  4. local UI = script.Parent
  5. local ShopFrame = UI:WaitForChild("ShopFrame")
  6. local TIP = UI:WaitForChild("ShopTooltip")
  7.  
  8. local function addComas(str)
  9. local x = tostring(str)
  10. return #x % 3 == 0 and str:reverse():gsub("(%d%d%d)", "%1,"):reverse():sub(2) or x:reverse():gsub("(%d%d%d)", "%1,"):reverse()
  11. end
  12.  
  13. if true then
  14. ShopFrame.Draggable = true
  15. end
  16.  
  17. for _,Element in pairs(ShopFrame:WaitForChild("Items"):GetChildren()) do
  18. if Element:IsA("TextButton") then
  19. local SelTool = GameItems:WaitForChild(Element:WaitForChild("Item").Value)
  20. local WPConfig = SelTool:FindFirstChild("WeaponConfig")
  21. local _MOD = require(WPConfig)
  22.  
  23. local function ComputerEnter()
  24. TIP:WaitForChild("ItemName").Text = Element:WaitForChild("Item").Value
  25. TIP:WaitForChild("ItemCost").Text = addComas(_MOD.Cost) .. " G$"
  26. TIP:WaitForChild("ItemInfo").Text = addComas(_MOD.MinDamage) .. "-" .. addComas(_MOD.MaxDamage) .. " DMG / CD: " .. addComas(_MOD.Cooldown)
  27. TIP.Position = UDim2.new(0,plr:GetMouse().X+1,0,plr:GetMouse().Y+30)
  28. TIP.Visible = true
  29. end
  30. local function ComputerMoved()
  31. TIP.Position = UDim2.new(0,plr:GetMouse().X+1,0,plr:GetMouse().Y+30)
  32. end
  33. local function ComputerLeave()
  34. TIP.Visible = false
  35. TIP:WaitForChild("ItemName").Text = tostring(nil)
  36. TIP:WaitForChild("ItemCost").Text = tostring(nil)
  37. TIP:WaitForChild("ItemInfo").Text = tostring(nil)
  38. TIP.Position = UDim2.new(0,0,0,0)
  39. end
  40. local function ConsoleEnter()
  41. TIP:WaitForChild("ItemName").Text = Element:WaitForChild("Item").Value
  42. TIP:WaitForChild("ItemCost").Text = addComas(_MOD.Cost) .. " G$"
  43. TIP:WaitForChild("ItemInfo").Text = addComas(_MOD.MinDamage) .. "-" .. addComas(_MOD.MaxDamage) .. " DMG / CD: " .. addComas(_MOD.Cooldown)
  44. TIP.Position = UDim2.new(0.325,0,0.5,100)
  45. TIP.Visible = true
  46. end
  47. local function ConsoleLeave()
  48. TIP.Visible = false
  49. TIP:WaitForChild("ItemName").Text = tostring(nil)
  50. TIP:WaitForChild("ItemCost").Text = tostring(nil)
  51. TIP:WaitForChild("ItemInfo").Text = tostring(nil)
  52. TIP.Position = UDim2.new(0,0,0,0)
  53. end
  54. Element.MouseEnter:Connect(ComputerEnter)
  55. Element.MouseMoved:Connect(ComputerMoved)
  56. Element.MouseLeave:Connect(ComputerLeave)
  57. Element.SelectionGained:Connect(ConsoleEnter)
  58. Element.SelectionLost:Connect(ConsoleLeave)
  59. end
  60. end
Add Comment
Please, Sign In to add comment