Advertisement
HHLExploits

Item spawner

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