Advertisement
lenard16jr

Auto Buy Lumber Tycoon 2

May 14th, 2021
360
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.69 KB | None | 0 0
  1. ocal ScreenGui = Instance.new("ScreenGui")
  2. local Main = Instance.new("Frame")
  3. local ScrollingFrame = Instance.new("ScrollingFrame")
  4. local Buy = Instance.new("TextButton")
  5. local WoodRUs = Instance.new("TextButton")
  6. local FurnitureStore = Instance.new("TextButton")
  7. local LogicStore = Instance.new("TextButton")
  8. local CarStore = Instance.new("TextButton")
  9. local ShackShop = Instance.new("TextButton")
  10. local FineArt = Instance.new("TextButton")
  11. local TextLabel = Instance.new("TextLabel")
  12. local Quantity = Instance.new("TextBox")
  13. local UpFrame = Instance.new("Frame")
  14. local Close = Instance.new("TextButton")
  15. local Item
  16.  
  17. ScreenGui.Parent = game.CoreGui
  18.  
  19. Main.Name = "Main"
  20. Main.Parent = UpFrame
  21. Main.BackgroundColor3 = Color3.new(0.541176, 0, 0.811765)
  22. Main.BorderSizePixel = 0
  23. Main.Position = UDim2.new(0, 0, 1.002788854, 0)
  24. Main.Size = UDim2.new(0, 350, 0, 198)
  25.  
  26. ScrollingFrame.Parent = Main
  27. ScrollingFrame.Active = true
  28. ScrollingFrame.BackgroundColor3 = Color3.new(0.443137, 0, 0.666667)
  29. ScrollingFrame.BorderSizePixel = 0
  30. ScrollingFrame.Position = UDim2.new(1, 0, 0, 0)
  31. ScrollingFrame.Size = UDim2.new(0, 136, 0, 198)
  32. ScrollingFrame.CanvasSize = UDim2.new(0, 0, 18, 0)
  33. ScrollingFrame.ScrollBarThickness = 8
  34.  
  35. Buy.Name = "Buy"
  36. Buy.Parent = Main
  37. Buy.BackgroundColor3 = Color3.new(0.168627, 0.960784, 1)
  38. Buy.BorderColor3 = Color3.new(0, 0, 0)
  39. Buy.BorderSizePixel = 3
  40. Buy.Position = UDim2.new(0.468571424, 0, 0.691919208, 0)
  41. Buy.Size = UDim2.new(0, 172, 0, 50)
  42. Buy.Font = Enum.Font.Garamond
  43. Buy.Text = "Buy Item"
  44. Buy.TextColor3 = Color3.new(0, 0, 0)
  45. Buy.TextScaled = true
  46. Buy.TextSize = 14
  47. Buy.TextWrapped = true
  48.  
  49. WoodRUs.Name = "WoodRUs"
  50. WoodRUs.Parent = Main
  51. WoodRUs.BackgroundColor3 = Color3.new(0.92549, 0, 0.0117647)
  52. WoodRUs.BorderSizePixel = 0
  53. WoodRUs.BorderColor3 = Color3.new(1, 0, 0)
  54. WoodRUs.Size = UDim2.new(0, 143, 0, 33)
  55. WoodRUs.Font = Enum.Font.SciFi
  56. WoodRUs.Text = "Wood R Us"
  57. WoodRUs.TextColor3 = Color3.new(0, 0, 0)
  58. WoodRUs.TextScaled = true
  59. WoodRUs.TextSize = 14
  60. WoodRUs.TextWrapped = true
  61.  
  62. FurnitureStore.Name = "FurnitureStore"
  63. FurnitureStore.Parent = Main
  64. FurnitureStore.BackgroundColor3 = Color3.new(0.92549, 0, 0.0117647)
  65. FurnitureStore.BorderSizePixel = 0
  66. FurnitureStore.BorderColor3 = Color3.new(1, 0, 0)
  67. FurnitureStore.Position = UDim2.new(0, 0, 0.166666672, 0)
  68. FurnitureStore.Size = UDim2.new(0, 143, 0, 33)
  69. FurnitureStore.Font = Enum.Font.SciFi
  70. FurnitureStore.Text = "Furniture"
  71. FurnitureStore.TextColor3 = Color3.new(0, 0, 0)
  72. FurnitureStore.TextScaled = true
  73. FurnitureStore.TextSize = 14
  74. FurnitureStore.TextWrapped = true
  75.  
  76. LogicStore.Name = "LogicStore"
  77. LogicStore.Parent = Main
  78. LogicStore.BackgroundColor3 = Color3.new(0.92549, 0, 0.0117647)
  79. LogicStore.BorderSizePixel = 0
  80. LogicStore.BorderColor3 = Color3.new(1, 0, 0)
  81. LogicStore.Position = UDim2.new(0, 0, 0.5, 0)
  82. LogicStore.Size = UDim2.new(0, 143, 0, 33)
  83. LogicStore.Font = Enum.Font.SciFi
  84. LogicStore.Text = "Logic Store"
  85. LogicStore.TextColor3 = Color3.new(0, 0, 0)
  86. LogicStore.TextScaled = true
  87. LogicStore.TextSize = 14
  88. LogicStore.TextWrapped = true
  89.  
  90. CarStore.Name = "CarStore"
  91. CarStore.Parent = Main
  92. CarStore.BackgroundColor3 = Color3.new(0.92549, 0, 0.0117647)
  93. CarStore.BorderSizePixel = 0
  94. CarStore.BorderColor3 = Color3.new(1, 0, 0)
  95. CarStore.Position = UDim2.new(0, 0, 0.333333343, 0)
  96. CarStore.Size = UDim2.new(0, 143, 0, 33)
  97. CarStore.Font = Enum.Font.SciFi
  98. CarStore.Text = "Car Store"
  99. CarStore.TextColor3 = Color3.new(0, 0, 0)
  100. CarStore.TextScaled = true
  101. CarStore.TextSize = 14
  102. CarStore.TextWrapped = true
  103.  
  104. ShackShop.Name = "ShackShop"
  105. ShackShop.Parent = Main
  106. ShackShop.BackgroundColor3 = Color3.new(0.92549, 0, 0.0117647)
  107. ShackShop.BorderSizePixel = 0
  108. ShackShop.BorderColor3 = Color3.new(1, 0, 0)
  109. ShackShop.Position = UDim2.new(0, 0, 0.833333313, 0)
  110. ShackShop.Size = UDim2.new(0, 143, 0, 33)
  111. ShackShop.Font = Enum.Font.SciFi
  112. ShackShop.Text = "Shack Shop"
  113. ShackShop.TextColor3 = Color3.new(0, 0, 0)
  114. ShackShop.TextScaled = true
  115. ShackShop.TextSize = 14
  116. ShackShop.TextWrapped = true
  117.  
  118. FineArt.Name = "FineArt"
  119. FineArt.Parent = Main
  120. FineArt.BackgroundColor3 = Color3.new(0.92549, 0, 0.0117647)
  121. FineArt.BorderSizePixel = 0
  122. FineArt.BorderColor3 = Color3.new(1, 0, 0)
  123. FineArt.Position = UDim2.new(0, 0, 0.666666687, 0)
  124. FineArt.Size = UDim2.new(0, 143, 0, 33)
  125. FineArt.Font = Enum.Font.SciFi
  126. FineArt.Text = "Fine Art"
  127. FineArt.TextColor3 = Color3.new(0, 0, 0)
  128. FineArt.TextScaled = true
  129. FineArt.TextSize = 14
  130. FineArt.TextWrapped = true
  131.  
  132. TextLabel.Name = "TextLabel"
  133. TextLabel.Parent = Main
  134. TextLabel.BackgroundColor3 = Color3.new(0, 1, 0.5)
  135. TextLabel.BorderSizePixel = 0
  136. TextLabel.Position = UDim2.new(0.468571424, 0, 0.435757578, 0)
  137. TextLabel.Size = UDim2.new(0, 172, 0, 35)
  138. TextLabel.Font = Enum.Font.SciFi
  139. TextLabel.Text = "No Item Selected"
  140. TextLabel.TextColor3 = Color3.new(0, 0, 0)
  141. TextLabel.TextScaled = true
  142. TextLabel.TextSize = 14
  143. TextLabel.TextWrapped = true
  144.  
  145. Quantity.Name = "Quantity"
  146. Quantity.Parent = Main
  147. Quantity.BackgroundColor3 = Color3.new(0, 1, 0.5)
  148. Quantity.BorderSizePixel = 0
  149. Quantity.Position = UDim2.new(0.578571424, 0, 0.105757578, 0)
  150. Quantity.Size = UDim2.new(0, 90, 0, 50)
  151. Quantity.Font = Enum.Font.SciFi
  152. Quantity.Text = "1"
  153. Quantity.PlaceholderText = "Quantity Here"
  154. Quantity.TextColor3 = Color3.new(0, 0, 0)
  155. Quantity.TextScaled = true
  156. Quantity.TextSize = 14
  157. Quantity.TextWrapped = true
  158.  
  159. UpFrame.Name = "UpFrame"
  160. UpFrame.Parent = ScreenGui
  161. UpFrame.BackgroundColor3 = Color3.new(0.109804, 0.886275, 0.835294)
  162. UpFrame.BorderSizePixel = 0
  163. UpFrame.Position = UDim2.new(0.266042769, 0, 0.302788854, 0)
  164. UpFrame.Size = UDim2.new(0, 486, 0, 23)
  165. UpFrame.Active = true
  166. UpFrame.Draggable = true
  167.  
  168. Close.Name = "Close"
  169. Close.Parent = UpFrame
  170. Close.BackgroundColor3 = Color3.new(1, 0, 0)
  171. Close.BorderSizePixel = 0
  172. Close.Position = UDim2.new(0.890946507, 0, 0, 0)
  173. Close.Size = UDim2.new(0, 53, 0, 23)
  174. Close.Font = Enum.Font.Fantasy
  175. Close.Text = "X"
  176. Close.TextColor3 = Color3.new(0, 0, 0)
  177. Close.TextScaled = true
  178. Close.TextSize = 14
  179. Close.TextWrapped = true
  180.  
  181. if game.Workspace.Stores:FindFirstChild("ShopItems") then
  182. for i,v in pairs(game.Workspace.Stores:GetDescendants()) do
  183. if v.Parent.Name == "ShopItems" then
  184. if v.Name == "Sawmill4L" then
  185. v.Parent.Name = "WoodRUs_"
  186. elseif v.Name == "Pickup1" then
  187. v.Parent.Name = "CarStore_"
  188. elseif v.Name == "LightBulb" then
  189. v.Parent.Name = "FurnitureStore_"
  190. elseif v.Name == "GateXOR" then
  191. v.Parent.Name = "LogicStore_"
  192. elseif v.Name == "CanOfWorms" then
  193. v.Parent.Name = "ShackShop_"
  194. elseif v.Name == "Painting8" then
  195. v.Parent.Name = "FineArt_"
  196. end
  197. end
  198. end
  199. end
  200.  
  201. local s = Instance.new("Sound")
  202.  
  203. function Sound11()
  204. s.Name = "Sound"
  205. s.SoundId = "rbxassetid://408524543"
  206. s.Volume = 2
  207. s.archivable = false
  208. s.Parent = game.Workspace
  209. s:play()
  210. end
  211. local Song1 = Instance.new("Sound")
  212. function Sound22()
  213.  
  214. Song1.Name = "Song1"
  215. Song1.SoundId = "rbxassetid://452267918"
  216. Song1.Volume = 2
  217. Song1.archivable = false
  218. Song1.Parent = game.Workspace
  219. Song1:play()
  220. end
  221.  
  222. local Buttons = { WoodRUs, FurnitureStore, LogicStore, CarStore, ShackShop, FineArt }
  223.  
  224. for i,v in pairs(Buttons) do
  225. v.MouseEnter:connect(function()
  226. Sound11()
  227. v.TextColor3 = Color3.new(0.168627, 0.960784, 1)
  228. end)
  229. v.MouseLeave:Connect(function()
  230. Sound11()
  231. v.TextColor3 = Color3.new(0, 0, 0)
  232. end)
  233. end
  234.  
  235. local Imagem = ""
  236.  
  237. function Picuture(Item)
  238. local Path
  239. for i,v in pairs(game.Workspace.Stores:GetChildren()) do
  240. if v:FindFirstChild(Item) then
  241. Path = v[Item]
  242. end
  243. end
  244.  
  245. for i,v in pairs(Path:GetDescendants()) do
  246. if v.ClassName == "Decal" then
  247. Imagem = v.Texture
  248. break
  249. end
  250. end
  251. end
  252.  
  253. Close.MouseButton1Down:connect(function()
  254. Sound22()
  255. ScreenGui:Destroy()
  256. end)
  257.  
  258. function Button(Type, Up, v)
  259. if Type == "TextButton" then
  260. Item = Instance.new(Type, ScrollingFrame)
  261. Item.Name = "Item"
  262. Item.BackgroundColor3 = Color3.new(0, 1, 0)
  263. Item.BorderSizePixel = 0
  264. Item.Position = UDim2.new(0, 0, Up, 0)
  265. Item.Size = UDim2.new(0, 127, 0, 29)
  266. Item.Visible = true
  267. Item.Font = Enum.Font.Arial
  268. Item.Text = v
  269. Item.TextColor3 = Color3.new(0, 0, 0)
  270. Item.TextScaled = true
  271. Item.TextSize = 14
  272. Item.TextWrapped = true
  273. Item.MouseButton1Down:connect(function()
  274. Sound22()
  275. TextLabel.Text = v
  276. end)
  277. Item.MouseEnter:connect(function()
  278. Sound11()
  279. end)
  280. else
  281. Item = Instance.new("TextLabel", ScrollingFrame)
  282. Item.Name = "Item"
  283. Item.BackgroundColor3 = Color3.new(1, 0, 0)
  284. Item.BorderSizePixel = 0
  285. Item.Position = UDim2.new(0, 0, Up, 0)
  286. Item.Size = UDim2.new(0, 127, 0, 29)
  287. Item.Visible = true
  288. Item.Font = Enum.Font.Arial
  289. Item.Text = v
  290. Item.TextColor3 = Color3.new(0, 0, 0)
  291. Item.TextScaled = true
  292. Item.TextSize = 14
  293. Item.TextWrapped = true
  294. end
  295. end
  296.  
  297. function ItemName(SIN)
  298. ScrollingFrame:ClearAllChildren()
  299. ScrollingFrame.CanvasPosition = Vector2.new(0,0)
  300. Nomes = ""
  301. local Items = {}
  302. local Counter = 0
  303. for i,v in pairs(game.Workspace.Stores[SIN]:GetChildren()) do
  304. if not string.find(Nomes, v.Name.."_") then
  305. Counter = Counter + 1
  306. Nomes = Nomes..v.Name.."_"
  307. Items[i] = v
  308. end
  309. end
  310.  
  311. local Count2 = 0.001
  312.  
  313. local Gift = ""
  314. for i,v in pairs(Items) do
  315. if v.Type.Value == "Gift" then
  316. Gift = v.Name
  317. break
  318. end
  319. end
  320.  
  321. if Gift ~= "" then
  322. Button("", Count2, "Gifts:")
  323. Count2 = Count2 + 0.009
  324. for i,v in pairs(Items) do
  325. if v.Type.Value == "Gift" then
  326. Button("TextButton", Count2, v.Name)
  327. Count2 = Count2 + 0.009
  328. wait()
  329. end
  330. end
  331. end
  332.  
  333. local Tool = ""
  334. for i,v in pairs(Items) do
  335. if v.Type.Value == "Tool" then
  336. Tool = v.Name
  337. break
  338. end
  339. end
  340.  
  341. if Tool ~= "" then
  342. Button("", Count2, "Axes:")
  343. Count2 = Count2 + 0.009
  344. for i,v in pairs(Items) do
  345. if v.Type.Value == "Tool" then
  346. Button("TextButton", Count2, v.Name)
  347. Count2 = Count2 + 0.009
  348. wait()
  349. end
  350. end
  351. end
  352.  
  353. local Structures = ""
  354. for i,v in pairs(Items) do
  355. if v.Type.Value == "Structure" then
  356. Structures = v.Name
  357. break
  358. end
  359. end
  360.  
  361. if Structures ~= "" then
  362. Button("", Count2, "Structures:")
  363. Count2 = Count2 + 0.009
  364. for i,v in pairs(Items) do
  365. if v.Type.Value == "Structure" then
  366. Button("TextButton", Count2, v.Name)
  367. Count2 = Count2 + 0.009
  368. wait()
  369. end
  370. end
  371. end
  372.  
  373. local Blueprint = ""
  374. for i,v in pairs(Items) do
  375. if v.Type.Value == "Blueprint" then
  376. Blueprint = v.Name
  377. break
  378. end
  379. end
  380.  
  381. if Blueprint ~= "" then
  382. Button("", Count2, "Blueprints:")
  383. Count2 = Count2 + 0.009
  384. for i,v in pairs(Items) do
  385. if v.Type.Value == "Blueprint" then
  386. Button("TextButton", Count2, v.Name)
  387. Count2 = Count2 + 0.009
  388. wait()
  389. end
  390. end
  391. end
  392.  
  393. local Wire = ""
  394. for i,v in pairs(Items) do
  395. if v.Type.Value == "Wire" then
  396. Wire = v.Name
  397. break
  398. end
  399. end
  400.  
  401. if Wire ~= "" then
  402. Button("", Count2, "Wires:")
  403. Count2 = Count2 + 0.009
  404. for i,v in pairs(Items) do
  405. if v.Type.Value == "Wire" then
  406. Button("TextButton", Count2, v.Name)
  407. Count2 = Count2 + 0.009
  408. wait()
  409. end
  410. end
  411. end
  412.  
  413. local Vehicle = ""
  414. for i,v in pairs(Items) do
  415. if v.Type.Value == "Vehicle" then
  416. Vehicle = v.Name
  417. break
  418. end
  419. end
  420.  
  421. if Vehicle ~= "" then
  422. Button("", Count2, "Vehicles:")
  423. Count2 = Count2 + 0.009
  424. for i,v in pairs(Items) do
  425. if v.Type.Value == "Vehicle" then
  426. Button("TextButton", Count2, v.Name)
  427. Count2 = Count2 + 0.009
  428. wait()
  429. end
  430. end
  431. end
  432.  
  433. local Others = ""
  434. for i,v in pairs(Items) do
  435. if v.Type.Value ~= "Blueprint" and v.Type.Value ~= "Structure" and v.Type.Value ~= "Tool" and v.Type.Value ~= "Wire" and v.Type.Value ~= "Vehicle" and v.Type.Value ~= "Gift" then
  436. Others = v.Name
  437. break
  438. end
  439. end
  440.  
  441. if Others ~= "" then
  442. Button("", Count2, "Others:")
  443. Count2 = Count2 + 0.009
  444. for i,v in pairs(Items) do
  445. if v.Type.Value ~= "Blueprint" and v.Type.Value ~= "Structure" and v.Type.Value ~= "Tool" and v.Type.Value ~= "Wire" and v.Type.Value ~= "Vehicle" and v.Type.Value ~= "Gift" then
  446. Button("TextButton", Count2, v.Name)
  447. Count2 = Count2 + 0.009
  448. wait()
  449. end
  450. end
  451. end
  452.  
  453. end
  454.  
  455. WoodRUs.MouseButton1Down:connect(function()
  456. Sound22()
  457. ItemName("WoodRUs_")
  458. end)
  459. FurnitureStore.MouseButton1Down:connect(function()
  460. Sound22()
  461. ItemName("FurnitureStore_")
  462. end)
  463.  
  464. LogicStore.MouseButton1Down:connect(function()
  465. Sound22()
  466. ItemName("LogicStore_")
  467. end)
  468.  
  469. CarStore.MouseButton1Down:connect(function()
  470. Sound22()
  471. ItemName("CarStore_")
  472. end)
  473.  
  474. ShackShop.MouseButton1Down:connect(function()
  475. Sound22()
  476. ItemName("ShackShop_")
  477. end)
  478.  
  479. FineArt.MouseButton1Down:connect(function()
  480. Sound22()
  481. ItemName("FineArt_")
  482. end)
  483.  
  484.  
  485. function Tlprt(XP,YP,ZP)
  486. -- Config How Many Blocks It Will Tp You Untill The Final Destination:
  487. local XTpEvery = 25
  488. local ZTpEvery = 25
  489. local YTpEvery = 25
  490. --Time to Tp Every:
  491. local Timer = 0.035
  492. --Script:
  493. local pos = game:GetService('Players').LocalPlayer.Character.HumanoidRootPart
  494. if pos.Position.X < XP then
  495. for x = pos.Position.X,XP,XTpEvery do
  496. game.Players.LocalPlayer.Character:MoveTo(Vector3.new(x,pos.Position.Y,pos.Position.Z))
  497. local part = Instance.new("Part", workspace)
  498. part.Anchored = true
  499. part.Size = Vector3.new(10,0.1,10)
  500. part.Material = "Glass"
  501. part.BrickColor = BrickColor.Random()
  502. part.Transparency = 0.7
  503. part.Position = game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.Position + Vector3.new(0,-3.05,0)
  504. wait(Timer)
  505. part.Destroy(part)
  506. end
  507. else
  508. for x = pos.Position.X,XP,-XTpEvery do
  509. game.Players.LocalPlayer.Character:MoveTo(Vector3.new(x,pos.Position.Y,pos.Position.Z))
  510. local part = Instance.new("Part", workspace)
  511. part.Anchored = true
  512. part.Size = Vector3.new(10,0.1,10)
  513. part.Material = "Glass"
  514. part.BrickColor = BrickColor.Random()
  515. part.Transparency = 0.7
  516. part.Position = game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.Position + Vector3.new(0,-3.05,0)
  517. wait(Timer)
  518. part.Destroy(part)
  519. end
  520. end
  521. if pos.Position.Z < ZP then
  522. for z = pos.Position.Z,ZP,ZTpEvery do
  523. game.Players.LocalPlayer.Character:MoveTo(Vector3.new(pos.Position.X,pos.Position.Y,z))
  524. local part = Instance.new("Part", workspace)
  525. part.Anchored = true
  526. part.Size = Vector3.new(10,0.1,10)
  527. part.Material = "Glass"
  528. part.BrickColor = BrickColor.Random()
  529. part.Transparency = 0.7
  530. part.Position = game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.Position + Vector3.new(0,-3.05,0)
  531. wait(Timer)
  532. part.Destroy(part)
  533. end
  534. else
  535. for z = pos.Position.Z,ZP,-ZTpEvery do
  536. game.Players.LocalPlayer.Character:MoveTo(Vector3.new(pos.Position.X,pos.Position.Y,z))
  537. local part = Instance.new("Part", workspace)
  538. part.Anchored = true
  539. part.Size = Vector3.new(10,0.1,10)
  540. part.Material = "Glass"
  541. part.BrickColor = BrickColor.Random()
  542. part.Transparency = 0.7
  543. part.Position = game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.Position + Vector3.new(0,-3.05,0)
  544. wait(Timer)
  545. part.Destroy(part)
  546. end
  547. end
  548. if pos.Position.Y < YP then
  549. for High = pos.Position.Y,YP,YTpEvery do
  550. game.Players.LocalPlayer.Character:MoveTo(Vector3.new(pos.Position.X ,High ,pos.Position.Z))
  551. local part = Instance.new("Part", workspace)
  552. part.Anchored = true
  553. part.Size = Vector3.new(10,0.1,10)
  554. part.Material = "Glass"
  555. part.BrickColor = BrickColor.Random()
  556. part.Transparency = 0.7
  557. part.Position = game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.Position + Vector3.new(0,-3.05,0)
  558. wait(Timer)
  559. part.Destroy(part)
  560. end
  561. else
  562. for High = pos.Position.Y,YP,-YTpEvery do
  563. game.Players.LocalPlayer.Character:MoveTo(Vector3.new(pos.Position.X ,High ,pos.Position.Z))
  564. local part = Instance.new("Part", workspace)
  565. part.Anchored = true
  566. part.Size = Vector3.new(10,0.1,10)
  567. part.Material = "Glass"
  568. part.BrickColor = BrickColor.Random()
  569. part.Transparency = 0.7
  570. part.Position = game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.Position + Vector3.new(0,-3.05,0)
  571. wait(Timer)
  572. part.Destroy(part)
  573. end
  574. end
  575. game.Players.LocalPlayer.Character:MoveTo(Vector3.new(XP,YP,ZP))
  576. end
  577.  
  578. function Check(Base)
  579. local Ch = game.Players.LocalPlayer.Character.HumanoidRootPart
  580.  
  581. if Base == nil then
  582. Base = game:GetService('Players').LocalPlayer.Character.Humanoid.Torso.CFrame
  583. end
  584.  
  585. for i,v in pairs(game.Workspace.PlayerModels:GetChildren()) do
  586. if string.find(v.Name, "Purchased by "..game.Players.LocalPlayer.Name) then
  587. if (Vector3.new(v.Main.CFrame.X) - Vector3.new(Ch.CFrame.X)).magnitude < 15 and (Vector3.new(v.Main.CFrame.Y) - Vector3.new(Ch.CFrame.Y)).magnitude < 15 and (Vector3.new(v.Main.CFrame.Z) - Vector3.new(Ch.CFrame.Z)).magnitude < 15 then
  588. for i=1,10 do
  589. wait()
  590. game.ReplicatedStorage.Interaction.ClientIsDragging:FireServer(v.PrimaryPart)
  591. game.ReplicatedStorage.Interaction.ClientRequestOwnership:FireServer(v.PrimaryPart)
  592. end
  593. v.PrimaryPart.CFrame = Base
  594. end
  595. end
  596. end
  597. end
  598.  
  599. function Drag(It)
  600. game.ReplicatedStorage.Interaction.ClientIsDragging:FireServer(It)
  601. end
  602.  
  603. function Move(X,Y,Z)
  604. game.Players.LocalPlayer.Character:MoveTo(Vector3.new(X,Y,Z))
  605. wait(0.1)
  606. end
  607.  
  608. Buy.MouseEnter:connect(function()
  609. Buy.BackgroundColor3 = Color3.new(0, 0, 0)
  610. Buy.BorderColor3 = Color3.new(1, 0, 0)
  611. Buy.TextColor3 = Color3.new(1, 0, 0)
  612. end)
  613. Buy.MouseLeave:Connect(function()
  614. Buy.BackgroundColor3 = Color3.new(0.168627, 0.960784, 1)
  615. Buy.BorderColor3 = Color3.new(0, 0, 0)
  616. Buy.TextColor3 = Color3.new(0, 0, 0)
  617. end)
  618.  
  619. Buy.MouseButton1Down:connect(function()
  620. Sound22()
  621. local Item = TextLabel.Text
  622. local Quant = Quantity.Text
  623.  
  624. local Base
  625. for i, v in pairs(game.Workspace.Properties:GetChildren()) do
  626. if v.Owner.Value == game.Players.LocalPlayer then
  627. Base = v.OriginSquare.CFrame + Vector3.new(0,5,0)
  628. end
  629. end
  630.  
  631. if Base == nil then
  632. Base = game:GetService('Players').LocalPlayer.Character.Humanoid.Torso.CFrame
  633. end
  634.  
  635. if Base ~= nil then
  636. local Cframe
  637. for i,v in pairs(game.Workspace.Stores:GetChildren()) do
  638. if v:FindFirstChild(Item) then
  639. if Item == "ManyAxe" then
  640. Tlprt(game.Workspace.ManyAxe.Position.X, game.Workspace.ManyAxe.Position.Y + 3, game.Workspace.ManyAxe.Position.Z)
  641. v:WaitForChild(Item)
  642. end
  643.  
  644. if v.Name == "WoodRUs_" then
  645. for i=1,Quant do
  646. Cframe = game.Workspace.Stores.WoodRUs.Counter
  647. if i == 1 then
  648. Tlprt(v[Item].Main.Position.X + 3 ,v[Item].Main.Position.Y ,v[Item].Main.Position.Z + 3)
  649. else
  650. Move(v[Item].Main.Position.X + 3 ,v[Item].Main.Position.Y ,v[Item].Main.Position.Z + 3)
  651. end
  652. Drag(v[Item])
  653. v[Item].Main.CFrame = Cframe.CFrame
  654. wait(0.1)
  655. Move(v[Item].Main.Position.X + 3 ,v[Item].Main.Position.Y ,v[Item].Main.Position.Z + 3)
  656. wait(0.4)
  657. local A_1 =
  658. {
  659. ["Character"] = game:GetService("Workspace").Stores.WoodRUs.Thom,
  660. ["Name"] = "Thom",
  661. ["ID"] = 11,
  662. ["Dialog"] = game:GetService("Workspace").Stores.WoodRUs.Thom.Dialog
  663. }
  664. local A_2 = "ConfirmPurchase"
  665. local Event = game:GetService("ReplicatedStorage").NPCDialog.PlayerChatted
  666. Event:InvokeServer(A_1, A_2)
  667. wait(0.1)
  668. Check(Base)
  669. v:WaitForChild(Item)
  670. end
  671. break
  672. elseif v.Name == "CarStore_" then
  673. Cframe = game.Workspace.Stores.CarStore.Counter
  674. for i=1,Quant do
  675. if i == 1 then
  676. Tlprt(v[Item].Main.Position.X + 3 ,v[Item].Main.Position.Y ,v[Item].Main.Position.Z + 3)
  677. else
  678. Move(v[Item].Main.Position.X + 3 ,v[Item].Main.Position.Y ,v[Item].Main.Position.Z + 3)
  679. end
  680. Drag(v[Item])
  681. v[Item].Main.CFrame = Cframe.CFrame
  682. wait(0.1)
  683. Move(v[Item].Main.Position.X + 3 ,v[Item].Main.Position.Y ,v[Item].Main.Position.Z + 3)
  684. wait(0.4)
  685. local A_1 =
  686. {
  687. ["Character"] = game:GetService("Workspace").Stores.CarStore.Jenny,
  688. ["Name"] = "Jenny",
  689. ["ID"] = 12,
  690. ["Dialog"] = game:GetService("Workspace").Stores.CarStore.Jenny.Dialog
  691. }
  692. local A_2 = "ConfirmPurchase"
  693. local Event = game:GetService("ReplicatedStorage").NPCDialog.PlayerChatted
  694. Event:InvokeServer(A_1, A_2)
  695. wait(0.1)
  696. Check(Base)
  697. v:WaitForChild(Item)
  698. end
  699. break
  700. elseif v.Name == "FurnitureStore_" then
  701. Cframe = game.Workspace.Stores.FurnitureStore.Counter
  702. for i=1,Quant do
  703. if i == 1 then
  704. Tlprt(v[Item].Main.Position.X + 3 ,v[Item].Main.Position.Y ,v[Item].Main.Position.Z + 3)
  705. else
  706. Move(v[Item].Main.Position.X + 3 ,v[Item].Main.Position.Y ,v[Item].Main.Position.Z + 3)
  707. end
  708. Drag(v[Item])
  709. v[Item].Main.CFrame = Cframe.CFrame
  710. wait(0.1)
  711. Move(v[Item].Main.Position.X + 3 ,v[Item].Main.Position.Y ,v[Item].Main.Position.Z + 3)
  712. wait(0.4)
  713. local A_1 =
  714. {
  715. ["Character"] = game:GetService("Workspace").Stores.FurnitureStore.Corey,
  716. ["Name"] = "Corey",
  717. ["ID"] = 10,
  718. ["Dialog"] = game:GetService("Workspace").Stores.FurnitureStore.Corey.Dialog
  719. }
  720. local A_2 = "ConfirmPurchase"
  721. local Event = game:GetService("ReplicatedStorage").NPCDialog.PlayerChatted
  722. Event:InvokeServer(A_1, A_2)
  723. wait(0.1)
  724. Check(Base)
  725. v:WaitForChild(Item)
  726. end
  727. break
  728. elseif v.Name == "LogicStore_" then
  729. Cframe = game.Workspace.Stores.LogicStore.Counter
  730. for i=1,Quant do
  731. if i == 1 then
  732. Tlprt(v[Item].Main.Position.X + 3 ,v[Item].Main.Position.Y ,v[Item].Main.Position.Z + 3)
  733. else
  734. Move(v[Item].Main.Position.X + 3 ,v[Item].Main.Position.Y ,v[Item].Main.Position.Z + 3)
  735. end
  736. Drag(v[Item])
  737. v[Item].Main.CFrame = Cframe.CFrame
  738. wait(0.1)
  739. Move(v[Item].Main.Position.X + 3 ,v[Item].Main.Position.Y ,v[Item].Main.Position.Z + 3)
  740. wait(0.4)
  741. local A_1 =
  742. {
  743. ["Character"] = game:GetService("Workspace").Stores.LogicStore.Lincoln,
  744. ["Name"] = "Lincoln",
  745. ["ID"] = 15,
  746. ["Dialog"] = game:GetService("Workspace").Stores.LogicStore.Lincoln.Dialog
  747. }
  748. local A_2 = "ConfirmPurchase"
  749. local Event = game:GetService("ReplicatedStorage").NPCDialog.PlayerChatted
  750. Event:InvokeServer(A_1, A_2)
  751. wait(0.1)
  752. Check(Base)
  753. v:WaitForChild(Item)
  754. end
  755. break
  756. elseif v.Name == "ShackShop_" then
  757. Cframe = game.Workspace.Stores.ShackShop.Counter
  758. for i=1,Quant do
  759. if i == 1 then
  760. Tlprt(v[Item].Main.Position.X + 3 ,v[Item].Main.Position.Y ,v[Item].Main.Position.Z + 3)
  761. else
  762. Move(v[Item].Main.Position.X + 3 ,v[Item].Main.Position.Y ,v[Item].Main.Position.Z + 3)
  763. end
  764. Drag(v[Item])
  765. v[Item].Main.CFrame = Cframe.CFrame
  766. wait(0.1)
  767. Move(v[Item].Main.Position.X + 3 ,v[Item].Main.Position.Y ,v[Item].Main.Position.Z + 3)
  768. wait(0.4)
  769. local A_1 =
  770. {
  771. ["Character"] = game:GetService("Workspace").Stores.ShackShop.Bob,
  772. ["Name"] = "Bob",
  773. ["ID"] = 13,
  774. ["Dialog"] = game:GetService("Workspace").Stores.ShackShop.Bob.Dialog
  775. }
  776. local A_2 = "ConfirmPurchase"
  777. local Event = game:GetService("ReplicatedStorage").NPCDialog.PlayerChatted
  778. Event:InvokeServer(A_1, A_2)
  779. wait(0.1)
  780. Check(Base)
  781. v:WaitForChild(Item)
  782. end
  783. break
  784. elseif v.Name == "FineArt_" then
  785. Cframe = game.Workspace.Stores.FineArt.Counter
  786. for i=1,Quant do
  787. if i == 1 then
  788. Tlprt(v[Item].Main.Position.X + 3 ,v[Item].Main.Position.Y ,v[Item].Main.Position.Z + 3)
  789. else
  790. Move(v[Item].Main.Position.X + 3 ,v[Item].Main.Position.Y ,v[Item].Main.Position.Z + 3)
  791. end
  792. Drag(v[Item])
  793. v[Item].Main.CFrame = Cframe.CFrame
  794. wait(0.1)
  795. Move(v[Item].Main.Position.X + 3 ,v[Item].Main.Position.Y ,v[Item].Main.Position.Z + 3)
  796. wait(0.4)
  797. local A_1 =
  798. {
  799. ["Character"] = game:GetService("Workspace").Stores.FineArt.Timothy,
  800. ["Name"] = "Timothy",
  801. ["ID"] = 14,
  802. ["Dialog"] = game:GetService("Workspace").Stores.FineArt.Timothy.Dialog
  803. }
  804. local A_2 = "ConfirmPurchase"
  805. local Event = game:GetService("ReplicatedStorage").NPCDialog.PlayerChatted
  806. Event:InvokeServer(A_1, A_2)
  807. wait(0.1)
  808. Check(Base)
  809. v:WaitForChild(Item)
  810. end
  811. break
  812. end
  813. end
  814. end
  815. Tlprt(Base.Position.X, Base.Position.Y, Base.Position.Z)
  816. end
  817. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement