Sakkzz

Boxes

Nov 11th, 2019
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.38 KB | None | 0 0
  1. local service = setmetatable({}, {__index = function(t, k) return game:GetService(k) end })
  2.  
  3. local BoxScreen = Instance.new("ScreenGui")
  4. local PurchasedFrame = Instance.new("Frame")
  5. local LastPurchasedList = Instance.new("ScrollingFrame")
  6. local TpAllBoxes = Instance.new("TextButton")
  7.  
  8. --Properties:
  9.  
  10. BoxScreen.Name = "BoxScreen"
  11. BoxScreen.Parent = game.CoreGui.LT2.MainFrame.ButtonFrame.TpBoxes
  12.  
  13. PurchasedFrame.Name = "PurchasedFrame"
  14. PurchasedFrame.Parent = BoxScreen
  15. PurchasedFrame.BackgroundColor3 = Color3.new(0.145098, 0.145098, 0.14902)
  16. PurchasedFrame.BorderColor3 = Color3.new(0, 0, 0)
  17. PurchasedFrame.BorderSizePixel = 2
  18. PurchasedFrame.Position = UDim2.new(0, -98, 0, -285)
  19. PurchasedFrame.Size = UDim2.new(0, 363, 0, 280)
  20.  
  21. LastPurchasedList.Name = "LastPurchasedList"
  22. LastPurchasedList.Parent = PurchasedFrame
  23. LastPurchasedList.BackgroundColor3 = Color3.new(0.145098, 0.145098, 0.14902)
  24. LastPurchasedList.BorderColor3 = Color3.new(0, 0, 0)
  25. LastPurchasedList.BorderSizePixel = 2
  26. LastPurchasedList.Size = UDim2.new(1, 0, 0, 230)
  27. LastPurchasedList.BottomImage = "rbxassetid://158362069"
  28. LastPurchasedList.MidImage = "rbxassetid://158362107"
  29. LastPurchasedList.TopImage = "rbxassetid://158362148"
  30.  
  31. TpAllBoxes.Name = "TpAllBoxes"
  32. TpAllBoxes.Parent = PurchasedFrame
  33. TpAllBoxes.BackgroundColor3 = Color3.new(0.054902, 0.054902, 0.0588235)
  34. TpAllBoxes.BorderColor3 = Color3.new(0, 0, 0)
  35. TpAllBoxes.BorderSizePixel = 2
  36. TpAllBoxes.Position = UDim2.new(0, 50, 0, 245)
  37. TpAllBoxes.Size = UDim2.new(0, 250, 0, 20)
  38. TpAllBoxes.Font = Enum.Font.Gotham
  39. TpAllBoxes.Text = "Teleport Purchased Boxes"
  40. TpAllBoxes.TextColor3 = Color3.new(1, 1, 1)
  41. TpAllBoxes.TextSize = 14
  42.  
  43. function Create(cls,props)
  44. local inst = Instance.new(cls)
  45. for i,v in pairs(props) do
  46. inst[i] = v
  47. end
  48. return inst
  49. end
  50. local MoneyCooldown = false
  51. local CurrentSlot = game.Players.LocalPlayer:WaitForChild("CurrentSaveSlot").Value
  52. local ScriptLoadOrSave = false
  53. local CurrentlySavingOrLoading = game.Players.LocalPlayer:WaitForChild("CurrentlySavingOrLoading")
  54. local TreeLogs={}
  55. local WoodPlanks={}
  56. local Render = service.RunService.RenderStepped
  57. local UserInputService = game:GetService("UserInputService")
  58. local shiftKeyL = Enum.KeyCode.LeftShift
  59. local Replicated = service.ReplicatedStorage
  60. local Client = Replicated.Interaction.ClientSetListPlayer
  61. local Dragging = Replicated.Interaction.ClientIsDragging
  62. local Properties = service.Workspace.Properties
  63. local Players = service.Players
  64. local PlayerModels = service.Workspace.PlayerModels
  65. local Player = Players.LocalPlayer
  66. local Char = Player.Character
  67. local Hum = Char.Humanoid
  68. local Root = Char.HumanoidRootPart
  69. local Mouse = Player:GetMouse()
  70. local Noclipper = false
  71. local Open = true
  72. local throwAxe = false
  73. local misc = false
  74. local player = false
  75. local slot = false
  76. local box = false
  77. local log = false
  78. local plank = false
  79. local players = false
  80. local wp = false
  81. local other = false
  82.  
  83. local inc = 0
  84. PlayerModels.ChildAdded:Connect(function(Item)
  85. inc = #LastPurchasedList:GetChildren()
  86. if Item:FindFirstChild("Owner") and Item.Owner.Value == Player then
  87. LastPurchasedList.CanvasSize=UDim2.new(0,0,0,25*inc)
  88. local SellButton=Create("TextButton",{Parent=LastPurchasedList,Size=UDim2.new(1,-9,0,20),Position=UDim2.new(0,5,0,25*inc),Text=" "..Item.Name,Name=Item.Name,TextXAlignment="Left",ZIndex=3,BorderSizePixel=0})
  89. SellButton.MouseButton1Click:Connect(function()
  90. if Item:IsA("Model") then
  91. Item:MoveTo(Root.Position)
  92. for i = 1,100 do
  93. Dragging:FireServer(Item)
  94. end
  95. end
  96. end)
  97. inc = inc + 1
  98. end
  99. end)
  100.  
  101. PlayerModels.ChildRemoved:Connect(function(Item)
  102. inc = 0
  103. if Item:FindFirstChild("Owner") and Item.Owner.Value == Player then
  104. if LastPurchasedList:FindFirstChild(Item.Name) then
  105. LastPurchasedList:FindFirstChild(Item.Name):Destroy()
  106. for i,v in pairs(LastPurchasedList:GetChildren()) do
  107. v.Position = UDim2.new(0,5,0,25*(i-1))
  108. end
  109. end
  110. end
  111. end)
  112.  
  113. --- Tp Boxes ---
  114.  
  115. TpBoxes.MouseButton1Down:connect(function()
  116. for i,v in pairs(PlayerModels:GetChildren()) do
  117. if v:IsA("Model") then
  118. if v:FindFirstChild("PurchasedBoxItemName") then
  119. if v.Type.Value == "Structure" or v.Type.Value == "Wire" or v.Type.Value == "Hatch" then
  120. if v.Owner.OwnerString.Value == Player.Name then
  121. v.Main.CFrame = service.Workspace:FindFirstChild(Player.Name).Torso.CFrame
  122. end
  123. end
  124. end
  125. end
  126. end
  127. end)
Add Comment
Please, Sign In to add comment