Advertisement
Anonymouse10101

Lumber Tycoon 2 Script Super Op

May 20th, 2019
5,249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.87 KB | None | 0 0
  1. Spawn Item:
  2. local Item = "ItemName"
  3. local Quantity = 10
  4.  
  5. local Land = nil
  6. for i,v in pairs(game.Workspace.Properties:GetChildren()) do
  7. if v.Owner.Value == game.Players.LocalPlayer then
  8. Land = v
  9. break
  10. end
  11. end
  12. if not Land then
  13. for i,v in pairs(game.Workspace.Properties:GetChildren()) do
  14. if v.Owner.Value == game.Players.LocalPlayer or v.Owner.Value == nil then
  15. Land = v
  16. game.ReplicatedStorage.Interaction.ClientIsDragging:FireServer(v)
  17. break
  18. end
  19. end
  20. end
  21.  
  22. function Spawn(Item)
  23. local Info = {}
  24. Info.Name = Item.Name
  25. Info.Type = game.ReplicatedStorage.Purchasables.Structures.HardStructures.Sawmill2.Type
  26. Info.OtherInfo = game.ReplicatedStorage.Purchasables.WireObjects.Wire.OtherInfo
  27. local Points = {Land.OriginSquare.Position + Vector3.new(0,5,0), Land.OriginSquare.Position + Vector3.new(0,5,0)}
  28. game.ReplicatedStorage.PlaceStructure.ClientPlacedWire:FireServer(Info, Points)
  29. end
  30.  
  31. for i=1, Quantity do
  32. Spawn(game.ReplicatedStorage.Purchasables:FindFirstChild(Item, true))
  33. end
  34.  
  35. Clone Gear:
  36. local Character = game.Players.LocalPlayer.Character
  37. local Mouse = game.Players.LocalPlayer:GetMouse()
  38. local Land = nil
  39.  
  40. for i,v in pairs(game.Workspace.Properties:GetChildren()) do
  41. if v.Owner.Value == game.Players.LocalPlayer or v.Owner.Value == nil then
  42. game.ReplicatedStorage.Interaction.ClientIsDragging:FireServer(v)
  43. break
  44. end
  45. end
  46.  
  47. for i,v in pairs(game.Workspace.Properties:GetChildren()) do
  48. if v.Owner.Value == game.Players.LocalPlayer then
  49. Land = v
  50. break
  51. end
  52. end
  53.  
  54. function Clone(Item)
  55. local Info = {}
  56. Info.Name = "Wire"
  57. Info.Type = Item
  58. Info.OtherInfo = game.ReplicatedStorage.Purchasables.WireObjects.Wire.OtherInfo
  59.  
  60. local Points = {Land.OriginSquare.Position - Vector3.new(0,100,0), Land.OriginSquare.Position - Vector3.new(0,100,0)}
  61. game.ReplicatedStorage.PlaceStructure.ClientPlacedWire:FireServer(Info, Points)
  62. end
  63.  
  64. local Tool = Instance.new("Tool")
  65. Tool.Name = "Clone"
  66. Tool.RequiresHandle = false
  67. Tool.Parent = game.Players.LocalPlayer.Backpack
  68.  
  69. Tool.Activated:Connect(function()
  70. if Mouse.Target and Land then
  71. local Target = Mouse.Target
  72.  
  73. if Target.Parent:IsA("Model") and Target.Parent:FindFirstChild("Main") then
  74. Target = Target.Parent
  75. elseif Target.Parent.Parent:IsA("Model") and Target.Parent.Parent:FindFirstChild("Main") then
  76. Target = Target.Parent.Parent
  77. elseif Target.Parent:IsA("Model") and Target.Parent:FindFirstChild("CutEvent") then
  78. Target = Target.Parent
  79. end
  80.  
  81. Clone(Target)
  82. else
  83. for i,v in pairs(game.Workspace.Properties:GetChildren()) do
  84. if v.Owner.Value == game.Players.LocalPlayer or v.Owner.Value == nil then
  85. game.ReplicatedStorage.Interaction.ClientIsDragging:FireServer(v)
  86. break
  87. end
  88. end
  89.  
  90. for i,v in pairs(game.Workspace.Properties:GetChildren()) do
  91. if v.Owner.Value == game.Players.LocalPlayer then
  92. Land = v
  93. break
  94. end
  95. end
  96. end
  97. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement