Advertisement
Guest User

Build Script

a guest
May 14th, 2019
25,812
0
Never
2
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. --Insert in a LocalScript inside of StarterPack
  2. local player = game.Players.LocalPlayer
  3. local mouse = player:GetMouse()
  4. local val
  5.  
  6. mouse.Button1Down:connect(function()
  7. if mouse.Target and mouse.Target.Name ~= "Baseplate" then
  8. local block = Instance.new("Part", workspace) -- new Block
  9. block.Anchored = true
  10. block.Size = Vector3.new(4,4,4) -- block size
  11. block.BrickColor = BrickColor.White()
  12. block.Name = "TempBlock"
  13. end
  14. end)
  15.  
  16. mouse.Button1Up:connect(function()
  17. if mouse.Target and mouse.Target.Name ~= "Baseplate" then
  18. local foundBlock = workspace:FindFirstChild("TempBlock")
  19. foundBlock.CFrame = CFrame.new(mouse.Target.Position) + Vector3.new(0,4,0)
  20. foundBlock.Name = "PlacedBlock"
  21. end
  22. end)
  23.  
  24. mouse.KeyUp:connect(function(k)
  25. local key = k:lower()
  26. if key == "r" then
  27. if mouse.Target.Name == "PlacedBlock" then
  28. mouse.Target:Destroy()
  29. end
  30. end
  31. end)
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement