awzp

Lua Pen (not the combat one or by me)

May 31st, 2018
361
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.28 KB | None | 0 0
  1. script.Parent = nil
  2. Player = game:GetService("Players").LocalPlayer
  3. Character = Player.Character
  4. TineID = "1033714"
  5. Make = Instance.new
  6. InkColor = "Navy blue"
  7.  
  8. Character.Humanoid.MaxHealth = math.huge
  9. Pen = Make("Model", Character)
  10. Pen.Name = "Pen"
  11.  
  12. MakePart = function(ID, Color, Ref, MeshType, Size, Scale, Name, WeldedTo, C0, C1)
  13. local Pen_Part = Make("Part", Pen)
  14. Pen_Part.Name = Name
  15. Pen_Part.BrickColor = BrickColor.new(Color)
  16. Pen_Part.Size = Size
  17. Pen_Part.Locked = true
  18. Pen_Part.Reflectance = Ref
  19. Pen_Part.TopSurface = "Smooth"
  20. Pen_Part.BottomSurface = "Smooth"
  21. local Pen_Mesh = Make("SpecialMesh", Pen_Part)
  22. Pen_Mesh.MeshId = "http://www.roblox.com/asset/?id="..ID
  23. Pen_Mesh.Scale = Scale
  24. Pen_Mesh.MeshType = MeshType
  25. local Weld = Make("Weld", Pen_Part)
  26. Weld.Part0 = Pen_Part
  27. Weld.Part1 = WeldedTo
  28. Weld.C0 = Weld.C0 * C0
  29. Weld.C1 = Weld.C1 * C1
  30. end
  31.  
  32. local Pen_Base = Make("Part", Pen)
  33. Pen_Base.BrickColor = BrickColor.new("Bright blue")
  34. Pen_Base.Name = "Pen Base"
  35. Pen_Base.Size = Vector3.new(3,15,3)
  36. Pen_Base.Locked = true
  37. Pen_Base_Mesh = Make("CylinderMesh", Pen_Base)
  38. Pen_6D = Make("BodyGyro", Pen_Base)
  39. Pen_6D.maxTorque = Vector3.new(math.huge, math.huge, math.huge)
  40. Pen_Move = Make("BodyPosition", Pen_Base)
  41. Pen_Move.maxForce = Vector3.new(math.huge, math.huge, math.huge)
  42. function Face(Object)
  43. Pen_Move.position = (Object).CFrame:toWorldSpace(CFrame.new(0,20,5)).p
  44. end
  45. Tine = MakePart(TineID, "Medium stone grey", 0.3, "FileMesh", Vector3.new(3,4,3), Vector3.new(1.5,4,1.5), "Tine", Pen_Base, CFrame.new(0,-8.7,0), CFrame.new(0,0,0))
  46. Ink_Top = MakePart(TineID, InkColor, 0, "FileMesh", Vector3.new(1,1,1), Vector3.new(0.3,1,0.3), "Ink Top", Pen_Base, CFrame.new(0,-10.2,0), CFrame.new(0,0,0))
  47. Clip = MakePart("", "Bright bluish green", 0.1, "Sphere", Vector3.new(1,7,1), Vector3.new(1,1,1), "Clip", Pen_Base, CFrame.new(1.7,-1,0), CFrame.new(0,0,0))
  48. Pen:MoveTo(Vector3.new(0,100,0))
  49. Face(Character.Torso)
  50.  
  51. function ChangeColor(Color)
  52. while true do
  53. wait()
  54. InkColor = Color
  55. end
  56. end
  57. Box = Make("SelectionBox", Player.PlayerGui)
  58. Pen_6D.cframe = CFrame.Angles(0,0,math.rad(-135))
  59. local Control = Make("HopperBin", Player.Backpack)
  60. Control.Name = "Pen"
  61. Control.Selected:connect(function(mouse)
  62. Box.Name = "Pen Selection"
  63. pcall(function()Box.Adornee = mouse.Target end)
  64. mouse.Button1Down:connect(function()
  65. local Clicked = mouse.Target
  66. local Laser = Make("FloorWire", Workspace)
  67. Laser.Color = BrickColor.new(InkColor)
  68. Laser.To = Clicked
  69. Laser.Name = "Pen Ink Laser"
  70. Laser.From = Pen["Ink Top"]
  71. wait(0.5)
  72. for i,v in pairs(Workspace:GetChildren())do
  73. if v.Name == "Pen Ink Laser" then
  74. v:remove()
  75. end
  76. end
  77. pcall(function()Clicked.Parent.Shirt:remove() end)
  78. pcall(function()Clicked.Parent.Pants:remove() end)
  79. pcall(function()Clicked.Parent.ShirtGraphic:remove() end)
  80. pcall(function()Clicked.Parent.Torso.roblox:remove() end)
  81. pcall(function()Clicked.BrickColor = BrickColor.new(InkColor)end)
  82. end)
  83. mouse.KeyDown:connect(function(Key)
  84. key = Key:lower()
  85. if key == "r" then ChangeColor("Navy blue")
  86. elseif key == "t" then ChangeColor("Bright green")
  87. elseif key == "y" then ChangeColor("Bright blue")
  88. elseif key == "u" then ChangeColor("Really red")
  89. elseif key == "f" then ChangeColor("New Yeller")
  90. elseif key == "g" then ChangeColor("Bright blue")
  91. elseif key == "h" then ChangeColor("Really black")
  92. elseif key == "j" then ChangeColor("Medium stone grey")
  93. elseif key == "z" then ChangeColor("Sand blue")
  94. elseif key == "x" then ChangeColor("Camo")
  95. elseif key == "c" then ChangeColor("Dusty Rose")
  96. elseif key == "v" then ChangeColor("Neon orange")
  97. elseif key == "b" then ChangeColor("Pastel green")
  98. elseif key == "n" then ChangeColor("Lime green")
  99. elseif key == "m" then ChangeColor("Hot pink")
  100. end
  101. end)
  102. while true do
  103. wait()
  104. Box.Adornee = mouse.Target
  105. Pen_6D.cframe = mouse.Hit:toWorldSpace(CFrame.Angles(math.rad(-100),0,0))
  106. Box.Color = BrickColor.new(InkColor)
  107. end
  108. end)
  109. Control.Deselected:connect(function()
  110. Pen_6D.cframe = CFrame.Angles(0,0,math.rad(-135))
  111. pcall(function()Player.PlayerGui["Pen Selection"]:remove() end)
  112. end)
  113.  
  114.  
  115. while true do
  116. wait()
  117. Face(Character.Torso)
  118. Pen["Ink Top"].BrickColor = BrickColor.new(InkColor)
  119. pcall(function()Player.PlayerGui["Pen Selection"].Color = BrickColor.new(InkColor) end)
  120. end
  121. print("Loaded Pen By LuaModelMaker")
Add Comment
Please, Sign In to add comment