MatLumber2

Clonar

May 20th, 2019
1,346
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.78 KB | None | 0 0
  1. local Character = game.Players.LocalPlayer.Character
  2. local Mouse = game.Players.LocalPlayer:GetMouse()
  3. local Land = nil
  4.  
  5. for i,v in pairs(game.Workspace.Properties:GetChildren()) do
  6. if v.Owner.Value == game.Players.LocalPlayer or v.Owner.Value == nil then
  7. game.ReplicatedStorage.Interaction.ClientIsDragging:FireServer(v)
  8. break
  9. end
  10. end
  11.  
  12. for i,v in pairs(game.Workspace.Properties:GetChildren()) do
  13. if v.Owner.Value == game.Players.LocalPlayer then
  14. Land = v
  15. break
  16. end
  17. end
  18.  
  19. function Clone(Item)
  20. local Info = {}
  21. Info.Name = "Wire"
  22. Info.Type = Item
  23. Info.OtherInfo = game.ReplicatedStorage.Purchasables.WireObjects.Wire.OtherInfo
  24.  
  25. local Points = {Land.OriginSquare.Position - Vector3.new(0,100,0), Land.OriginSquare.Position - Vector3.new(0,100,0)}
  26. game.ReplicatedStorage.PlaceStructure.ClientPlacedWire:FireServer(Info, Points)
  27. end
  28.  
  29. local Tool = Instance.new("Tool")
  30. Tool.Name = "Clone"
  31. Tool.RequiresHandle = false
  32. Tool.Parent = game.Players.LocalPlayer.Backpack
  33.  
  34. Tool.Activated:Connect(function()
  35. if Mouse.Target and Land then
  36. local Target = Mouse.Target
  37.  
  38. if Target.Parent:IsA("Model") and Target.Parent:FindFirstChild("Main") then
  39. Target = Target.Parent
  40. elseif Target.Parent.Parent:IsA("Model") and Target.Parent.Parent:FindFirstChild("Main") then
  41. Target = Target.Parent.Parent
  42. elseif Target.Parent:IsA("Model") and Target.Parent:FindFirstChild("CutEvent") then
  43. Target = Target.Parent
  44. end
  45.  
  46. Clone(Target)
  47. else
  48. for i,v in pairs(game.Workspace.Properties:GetChildren()) do
  49. if v.Owner.Value == game.Players.LocalPlayer or v.Owner.Value == nil then
  50. game.ReplicatedStorage.Interaction.ClientIsDragging:FireServer(v)
  51. break
  52. end
  53. end
  54.  
  55. for i,v in pairs(game.Workspace.Properties:GetChildren()) do
  56. if v.Owner.Value == game.Players.LocalPlayer then
  57. Land = v
  58. break
  59. end
  60. end
  61. end
  62. end)
Add Comment
Please, Sign In to add comment