Flamingo123

Roblox script Lua Pen

Dec 8th, 2018
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 28.22 KB | None | 0 0
  1. --[[ last updated: 2018/5/13, 15:30
  2.  
  3. Pen by oilsauce.]]
  4.  
  5. print("Pen Script by Oilsauce.")
  6. print("Click: Stab")
  7. print("E: Toggle Pen")
  8. print("F: Throw Pen")
  9.  
  10. -----------------------------------------------------------------------------------
  11.  
  12. local plrs = game:GetService("Players")
  13. local plr = plrs.LocalPlayer
  14. local char = plr.Character
  15. local tweenserv = game:GetService("TweenService")
  16. local lighting = game:GetService("Lighting")
  17. local hum = char:FindFirstChildOfClass("Humanoid")
  18. local mou = plr:GetMouse()
  19. local tor = char:FindFirstChild("Torso") or char:FindFirstChild("UpperTorso")
  20. local root = char:FindFirstChild("HumanoidRootPart")
  21. local head = char:FindFirstChild("Head")
  22. local face = head:FindFirstChildOfClass("Decal")
  23. local larm = char:FindFirstChild("Left Arm") or char:FindFirstChild("LeftUpperArm")
  24. local rarm = char:FindFirstChild("Right Arm") or char:FindFirstChild("RightUpperArm")
  25. local rleg = char:FindFirstChild("Right Leg") or char:FindFirstChild("RightUpperLeg")
  26. local lleg = char:FindFirstChild("Left Leg") or char:FindFirstChild("LeftUpperLeg")
  27. local neck = tor:FindFirstChild("Neck")
  28. local rootj = root:FindFirstChild("RootJoint")
  29. local LS = tor:FindFirstChild("Left Shoulder")
  30. local RS = tor:FindFirstChild("Right Shoulder")
  31. local LH = tor:FindFirstChild("Left Hip")
  32. local RH = tor:FindFirstChild("Right Hip")
  33. local bp = plr:FindFirstChild("Backpack")
  34.  
  35. hum:ClearAllChildren()
  36. char.Animate:remove()
  37.  
  38.  
  39. --Converted with ttyyuu12345's model to script plugin v4
  40. function sandbox(var,func)
  41. local env = getfenv(func)
  42. local newenv = setmetatable({},{
  43. __index = function(self,k)
  44. if k=="script" then
  45. return var
  46. else
  47. return env[k]
  48. end
  49. end,
  50. })
  51. setfenv(func,newenv)
  52. return func
  53. end
  54. cors = {}
  55. mas = Instance.new("Model",game:GetService("Lighting"))
  56. Model0 = Instance.new("Model")
  57. Part1 = Instance.new("Part")
  58. Part2 = Instance.new("Part")
  59. ManualWeld3 = Instance.new("ManualWeld")
  60. Part4 = Instance.new("Part")
  61. ManualWeld5 = Instance.new("ManualWeld")
  62. Part6 = Instance.new("Part")
  63. ManualWeld7 = Instance.new("ManualWeld")
  64. Part8 = Instance.new("Part")
  65. ManualWeld9 = Instance.new("ManualWeld")
  66. Part10 = Instance.new("Part")
  67. ManualWeld11 = Instance.new("ManualWeld")
  68. Part12 = Instance.new("Part")
  69. ManualWeld13 = Instance.new("ManualWeld")
  70. Model0.Name = "pen"
  71. Model0.Parent = mas
  72. Part1.Name = "handler2"
  73. Part1.Parent = Model0
  74. Part1.Material = Enum.Material.Glass
  75. Part1.BrickColor = BrickColor.new("Really black")
  76. Part1.Shape = Enum.PartType.Cylinder
  77. Part1.Size = Vector3.new(0.099999927, 0.075000003, 0.075000003)
  78. Part1.CFrame = CFrame.new(0.422837317, 4.01673937, 24.1206856, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  79. Part1.BottomSurface = Enum.SurfaceType.Smooth
  80. Part1.TopSurface = Enum.SurfaceType.Smooth
  81. Part1.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  82. Part1.Position = Vector3.new(0.422837317, 4.01673937, 24.1206856)
  83. Part1.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  84. Part2.Name = "handler1"
  85. Part2.Parent = Model0
  86. Part2.Material = Enum.Material.Glass
  87. Part2.BrickColor = BrickColor.new("Really black")
  88. Part2.Shape = Enum.PartType.Cylinder
  89. Part2.Size = Vector3.new(0.099999927, 0.100000001, 0.100000001)
  90. Part2.CFrame = CFrame.new(0.356837302, 4.02223921, 24.1206856, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  91. Part2.BottomSurface = Enum.SurfaceType.Smooth
  92. Part2.TopSurface = Enum.SurfaceType.Smooth
  93. Part2.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  94. Part2.Position = Vector3.new(0.356837302, 4.02223921, 24.1206856)
  95. Part2.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  96. ManualWeld3.Name = "Weld"
  97. ManualWeld3.Parent = Part2
  98. ManualWeld3.C1 = CFrame.new(-0.0660000145, 0.00549983978, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  99. ManualWeld3.Part0 = Part2
  100. ManualWeld3.Part1 = Part1
  101. Part4.Name = "body"
  102. Part4.Parent = Model0
  103. Part4.Material = Enum.Material.Glass
  104. Part4.BrickColor = BrickColor.new("Really black")
  105. Part4.Shape = Enum.PartType.Cylinder
  106. Part4.Size = Vector3.new(1.27499998, 0.125, 0.125)
  107. Part4.CFrame = CFrame.new(-0.320662677, 4.02673912, 24.1206856, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  108. Part4.BottomSurface = Enum.SurfaceType.Smooth
  109. Part4.TopSurface = Enum.SurfaceType.Smooth
  110. Part4.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  111. Part4.Position = Vector3.new(-0.320662677, 4.02673912, 24.1206856)
  112. Part4.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  113. ManualWeld5.Name = "Weld"
  114. ManualWeld5.Parent = Part4
  115. ManualWeld5.C1 = CFrame.new(-0.743499994, 0.00999975204, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  116. ManualWeld5.Part0 = Part4
  117. ManualWeld5.Part1 = Part1
  118. Part6.Name = "clipholder"
  119. Part6.Parent = Model0
  120. Part6.Material = Enum.Material.Glass
  121. Part6.BrickColor = BrickColor.new("Really black")
  122. Part6.Shape = Enum.PartType.Cylinder
  123. Part6.Size = Vector3.new(0.2, 0.150000006, 0.150000006)
  124. Part6.CFrame = CFrame.new(-0.986662686, 4.02623892, 24.1206856, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  125. Part6.BottomSurface = Enum.SurfaceType.Smooth
  126. Part6.TopSurface = Enum.SurfaceType.Smooth
  127. Part6.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  128. Part6.Position = Vector3.new(-0.986662686, 4.02623892, 24.1206856)
  129. Part6.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  130. ManualWeld7.Name = "Weld"
  131. ManualWeld7.Parent = Part6
  132. ManualWeld7.C1 = CFrame.new(-1.4095, 0.00949954987, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  133. ManualWeld7.Part0 = Part6
  134. ManualWeld7.Part1 = Part1
  135. Part8.Name = "clip"
  136. Part8.Parent = Model0
  137. Part8.Material = Enum.Material.Glass
  138. Part8.BrickColor = BrickColor.new("Really black")
  139. Part8.Size = Vector3.new(0.724999905, 0.0500000119, 0.100000001)
  140. Part8.CFrame = CFrame.new(-0.663956106, 4.10453987, 24.1179676, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  141. Part8.BottomSurface = Enum.SurfaceType.Smooth
  142. Part8.TopSurface = Enum.SurfaceType.Smooth
  143. Part8.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  144. Part8.Position = Vector3.new(-0.663956106, 4.10453987, 24.1179676)
  145. Part8.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  146. ManualWeld9.Name = "Weld"
  147. ManualWeld9.Parent = Part8
  148. ManualWeld9.C1 = CFrame.new(-1.08679342, 0.0878005028, -0.0027179718, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  149. ManualWeld9.Part0 = Part8
  150. ManualWeld9.Part1 = Part1
  151. Part10.Name = "button"
  152. Part10.Parent = Model0
  153. Part10.Material = Enum.Material.Glass
  154. Part10.BrickColor = BrickColor.new("Dark indigo")
  155. Part10.Shape = Enum.PartType.Cylinder
  156. Part10.Size = Vector3.new(0.14, 0.125, 0.125)
  157. Part10.CFrame = CFrame.new(-1.09316278, 4.02473927, 24.1206856, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  158. Part10.BottomSurface = Enum.SurfaceType.Smooth
  159. Part10.TopSurface = Enum.SurfaceType.Smooth
  160. Part10.Color = Color3.new(0.239216, 0.0823529, 0.521569)
  161. Part10.Position = Vector3.new(-1.09316278, 4.02473927, 24.1206856)
  162. Part10.Color = Color3.new(0.239216, 0.0823529, 0.521569)
  163. ManualWeld11.Name = "Weld"
  164. ManualWeld11.Parent = Part10
  165. ManualWeld11.C1 = CFrame.new(-1.51600003, 0.007999897, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  166. ManualWeld11.Part0 = Part10
  167. ManualWeld11.Part1 = Part1
  168. Part12.Name = "sharp"
  169. Part12.Parent = Model0
  170. Part12.Material = Enum.Material.Glass
  171. Part12.Shape = Enum.PartType.Cylinder
  172. Part12.Size = Vector3.new(0.099999927, 0.0500000007, 0.0500000007)
  173. Part12.CFrame = CFrame.new(0.484837323, 4.01723957, 24.1206856, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  174. Part12.BottomSurface = Enum.SurfaceType.Smooth
  175. Part12.TopSurface = Enum.SurfaceType.Smooth
  176. Part12.Position = Vector3.new(0.484837323, 4.01723957, 24.1206856)
  177. ManualWeld13.Name = "Weld"
  178. ManualWeld13.Parent = Part12
  179. ManualWeld13.C1 = CFrame.new(0.0620000064, 0.000500202179, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  180. ManualWeld13.Part0 = Part12
  181. ManualWeld13.Part1 = Part1
  182. for i,v in pairs(mas:GetChildren()) do
  183. v.Parent = char
  184. pen = v
  185. body = Part4
  186. button = Part10
  187. pcall(function() v:MakeJoints() end)
  188. end
  189. mas:Destroy()
  190. for i,v in pairs(cors) do
  191. spawn(function()
  192. pcall(v)
  193. end)
  194. end
  195.  
  196. local rootj0 = rootj.C0
  197. local neck0 = neck.C0
  198. local LS0 = LS.C0
  199. local RS0 = RS.C0
  200. local LH0 = LH.C0
  201. local RH0 = RH.C0
  202. local rootj1 = rootj.C1
  203. local neck1 = neck.C1
  204. local LS1 = LS.C1
  205. local RS1 = RS.C1
  206. local LH1 = LH.C1
  207. local RH1 = RH.C1
  208.  
  209. -----------------------------------------------------------------------------------
  210.  
  211. local CFn = CFrame.new
  212. local CFa = CFrame.Angles
  213. local Rad = math.rad
  214. local Sin = math.sin
  215. local Cos = math.cos
  216. local sine = 1
  217.  
  218. local penp = Instance.new("Part", char)
  219. penp.Size = Vector3.new(1, 1, 1)
  220. penp.CanCollide = false
  221. penp.Transparency = 1
  222. local penpw = Instance.new("Weld", penp)
  223. penpw.Part0 = rarm
  224. penpw.Part1 = penp
  225. penpw.C1 = CFn(0, -1, 0) * CFa(0, 0, Rad(180))
  226. local penpw0 = penpw.C0
  227. local penpw1 = penpw.C1
  228.  
  229. local penw = Instance.new("Weld", body)
  230. penw.Name = "penWeld22"
  231. penw.Part0 = penp
  232. penw.Part1 = body
  233. penw.C1 = CFa(0, 0, Rad(180))
  234. local penw0 = penw.C0
  235. local penw1 = penw.C1
  236.  
  237. local sharpw = ManualWeld13
  238. local sharpw0 = ManualWeld13.C0
  239. local sharpw1 = ManualWeld13.C1
  240. local sharpw02 = CFn(0.3, 0, 0)
  241. sharpw.C0 = sharpw02
  242.  
  243. local botw = ManualWeld11
  244. local botw0 = ManualWeld11.C0
  245. local botw1 = ManualWeld11.C1
  246. local botw02 = CFn(-0.07, 0, 0)
  247. botw.C0 = botw0
  248.  
  249. -----------------------------------------------------------------------------------
  250.  
  251. local ws = 16
  252. local jp = 50
  253. local out = false
  254. local ouch = false
  255. local hitok = false
  256. local canattack = true
  257. local stabstate = 1
  258. local Stabbing = false
  259. local Throwing = false
  260. local rot = 1
  261. local dmg = 5
  262.  
  263. -----------------------------------------------------------------------------------
  264.  
  265. ArtificialHB = Instance.new("BindableEvent", script)
  266. ArtificialHB.Name = "Heartbeat"
  267. script:WaitForChild("Heartbeat")
  268.  
  269. frame = 1 / 60
  270. tf = 0
  271. allowframeloss = false
  272. tossremainder = false
  273.  
  274.  
  275. lastframe = tick()
  276. script.Heartbeat:Fire()
  277.  
  278.  
  279. game:GetService("RunService").Heartbeat:connect(function(s, p)
  280. tf = tf + s
  281. if tf >= frame then
  282. if allowframeloss then
  283. script.Heartbeat:Fire()
  284. lastframe = tick()
  285. else
  286. for i = 1, math.floor(tf / frame) do
  287. script.Heartbeat:Fire()
  288. end
  289. lastframe = tick()
  290. end
  291. if tossremainder then
  292. tf = 0
  293. else
  294. tf = tf - frame * math.floor(tf / frame)
  295. end
  296. end
  297. end)
  298.  
  299. function swait(num)
  300. if num == 0 or num == nil then
  301. game:service("RunService").Stepped:wait(0)
  302. else
  303. for i = 0, num do
  304. game:service("RunService").Stepped:wait(0)
  305. end
  306. end
  307. end
  308.  
  309. function clerp(a, b, t)
  310. return a:lerp(b, t)
  311. end
  312.  
  313. function ToggleSharp()
  314. if not button:FindFirstChild("Penclickit360") then
  315. local clickso = Instance.new("Sound", button)
  316. clickso.SoundId = "rbxassetid://537744814"
  317. clickso.Name = "Penclickit360"
  318. clickso.Volume = 5
  319. clickso:Play()
  320. else
  321. local clickso = button:FindFirstChild("Penclickit360")
  322. clickso:Play()
  323. end
  324. if out == false then
  325. sharpw.C0 = sharpw0
  326. botw.C0 = botw02
  327. dmg = 30
  328. out = true
  329. else
  330. sharpw.C0 = sharpw02
  331. botw.C0 = botw0
  332. dmg = 5
  333. out = false
  334. end
  335. end
  336.  
  337. function Stab()
  338. if stabstate == 1 and canattack == true then
  339. Stabbing = true
  340. canattack = false
  341. stabstate = 2
  342. hum.WalkSpeed = 3
  343. hum.JumpPower = 7
  344. hitok = true
  345. body.Touched:connect(function(hit)
  346. if hitok == true and not hit:IsDescendantOf(char) and hit.Parent:FindFirstChildOfClass("Humanoid") then
  347. hitok = false
  348. local owdude = hit.Parent
  349. local owhum = owdude:FindFirstChildOfClass("Humanoid")
  350. owhum.Health = owhum.Health - dmg
  351. if out == true then
  352. local bloodsound = Instance.new("Sound", hit)
  353. bloodsound.Volume = 10
  354. bloodsound.SoundId = "rbxassetid://180083298"
  355. bloodsound:Play()
  356. game:GetService("Debris"):AddItem(bloodsound, 1)
  357. local bloodsplash = Instance.new("ParticleEmitter", hit)
  358. bloodsplash.Lifetime = NumberRange.new(0.7, 1)
  359. bloodsplash.Speed = NumberRange.new(6)
  360. bloodsplash.SpreadAngle = Vector2.new(-360, 360)
  361. bloodsplash.Rate = 1000
  362. bloodsplash.Size = NumberSequence.new({NumberSequenceKeypoint.new(0, 3), NumberSequenceKeypoint.new(1, 0)})
  363. bloodsplash.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0, 0.2), NumberSequenceKeypoint.new(1, 1)})
  364. bloodsplash.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 255, 255)), ColorSequenceKeypoint.new(1, Color3.fromRGB(0, 0, 0))})
  365. bloodsplash.Texture = "rbxassetid://771221224"
  366. game:GetService("Debris"):AddItem(bloodsplash, 1)
  367. wait(0.25)
  368. bloodsplash.Enabled = false
  369. end
  370. end
  371. if hitok == true and not hit:IsDescendantOf(char) and hit.Parent.Parent:FindFirstChildOfClass("Humanoid") then
  372. hitok = false
  373. local owdude = hit.Parent.Parent
  374. local owhum = owdude:FindFirstChildOfClass("Humanoid")
  375. owhum.Health = owhum.Health - dmg
  376. if out == true then
  377. local bloodsound = Instance.new("Sound", hit)
  378. bloodsound.Volume = 10
  379. bloodsound.SoundId = "rbxassetid://180083298"
  380. bloodsound:Play()
  381. game:GetService("Debris"):AddItem(bloodsound, 1)
  382. local bloodsplash = Instance.new("ParticleEmitter", hit)
  383. bloodsplash.Lifetime = NumberRange.new(0.7, 1)
  384. bloodsplash.Speed = NumberRange.new(6)
  385. bloodsplash.SpreadAngle = Vector2.new(-360, 360)
  386. bloodsplash.Rate = 1000
  387. bloodsplash.Size = NumberSequence.new({NumberSequenceKeypoint.new(0, 3), NumberSequenceKeypoint.new(1, 0)})
  388. bloodsplash.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0, 0.2), NumberSequenceKeypoint.new(1, 1)})
  389. bloodsplash.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 255, 255)), ColorSequenceKeypoint.new(1, Color3.fromRGB(0, 0, 0))})
  390. bloodsplash.Texture = "rbxassetid://771221224"
  391. game:GetService("Debris"):AddItem(bloodsplash, 1)
  392. wait(0.25)
  393. bloodsplash.Enabled = false
  394. end
  395. end
  396. end)
  397. for i = 0,1,.15 do
  398. penw.C1 = clerp(penw.C1, penw1 * CFa(0, Rad(-90), 0), i)
  399. neck.C1 = clerp(neck.C1, neck1 * CFa(Rad(-2), 0, 0), i)
  400. rootj.C1 = clerp(rootj.C1, rootj1 * CFn(0, 0, 0.025), i)
  401. LS.C1 = clerp(LS.C1, LS1 * CFa(Rad(-30), 0, Rad(-40)), i)
  402. RS.C1 = clerp(RS.C1, RS1 * CFa(Rad(-30), Rad(-30), Rad(-3)), i)
  403. LH.C1 = clerp(LH.C1, LH1 * CFn(0, -0.025, 0) * CFa(Rad(5), Rad(-5), 0), i)
  404. RH.C1 = clerp(RH.C1, RH1 * CFn(0, -0.025, 0) * CFa(Rad(5), Rad(5), 0), i)
  405. LS.C0 = clerp(LS.C0, LS0, i)
  406. RS.C0 = clerp(RS.C0, RS0 * CFa(0, 0, Rad(150)), i)
  407. LH.C0 = clerp(LH.C0, LH0, i)
  408. RH.C0 = clerp(RH.C0, RH0, i)
  409. swait()
  410. end
  411. for i = 0,1,.15 do
  412. penw.C1 = clerp(penw.C1, penw1 * CFa(0, Rad(-90), 0), i)
  413. neck.C1 = clerp(neck.C1, neck1 * CFa(Rad(-2), 0, 0), i)
  414. rootj.C1 = clerp(rootj.C1, rootj1 * CFn(0, 0, 0.025), i)
  415. LS.C1 = clerp(LS.C1, LS1 * CFa(Rad(-30), 0, Rad(-40)), i)
  416. RS.C1 = clerp(RS.C1, RS1 * CFa(Rad(20), Rad(-30), Rad(-3)), i)
  417. LH.C1 = clerp(LH.C1, LH1 * CFn(0, -0.025, 0) * CFa(Rad(5), Rad(-5), 0), i)
  418. RH.C1 = clerp(RH.C1, RH1 * CFn(0, -0.025, 0) * CFa(Rad(5), Rad(5), 0), i)
  419. LS.C0 = clerp(LS.C0, LS0, i)
  420. RS.C0 = clerp(RS.C0, RS0 * CFa(0, 0, Rad(20)), i)
  421. LH.C0 = clerp(LH.C0, LH0, i)
  422. RH.C0 = clerp(RH.C0, RH0, i)
  423. swait()
  424. end
  425. hitok = false
  426. hum.WalkSpeed = ws
  427. hum.JumpPower = jp
  428. canattack = true
  429. Stabbing = false
  430. elseif stabstate == 2 and canattack == true then
  431. canattack = false
  432. stabstate = 1
  433. hum.WalkSpeed = 3
  434. hum.JumpPower = 7
  435. hitok = true
  436. body.Touched:connect(function(hit)
  437. if hitok == true and not hit:IsDescendantOf(char) and hit.Parent:FindFirstChildOfClass("Humanoid") then
  438. local owdude = hit.Parent
  439. local owhum = owdude:FindFirstChildOfClass("Humanoid")
  440. owhum.Health = owhum.Health - dmg
  441. if out == true then
  442. local bloodsound = Instance.new("Sound", hit)
  443. bloodsound.Volume = 10
  444. bloodsound.SoundId = "rbxassetid://180083298"
  445. bloodsound:Play()
  446. game:GetService("Debris"):AddItem(bloodsound, 1)
  447. local bloodsplash = Instance.new("ParticleEmitter", hit)
  448. bloodsplash.Lifetime = NumberRange.new(0.7, 1)
  449. bloodsplash.Speed = NumberRange.new(6)
  450. bloodsplash.SpreadAngle = Vector2.new(-360, 360)
  451. bloodsplash.Rate = 1000
  452. bloodsplash.Size = NumberSequence.new({NumberSequenceKeypoint.new(0, 3), NumberSequenceKeypoint.new(1, 0)})
  453. bloodsplash.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0, 0.2), NumberSequenceKeypoint.new(1, 1)})
  454. bloodsplash.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 255, 255)), ColorSequenceKeypoint.new(1, Color3.fromRGB(0, 0, 0))})
  455. bloodsplash.Texture = "rbxassetid://771221224"
  456. game:GetService("Debris"):AddItem(bloodsplash, 1)
  457. wait(0.25)
  458. bloodsplash.Enabled = false
  459. end
  460. end
  461. if hitok == true and not hit:IsDescendantOf(char) and hit.Parent.Parent:FindFirstChildOfClass("Humanoid") then
  462. hitok = false
  463. local owdude = hit.Parent.Parent
  464. local owhum = owdude:FindFirstChildOfClass("Humanoid")
  465. owhum.Health = owhum.Health - dmg
  466. if out == true then
  467. local bloodsound = Instance.new("Sound", hit)
  468. bloodsound.Volume = 10
  469. bloodsound.SoundId = "rbxassetid://180083298"
  470. bloodsound:Play()
  471. game:GetService("Debris"):AddItem(bloodsound, 1)
  472. local bloodsplash = Instance.new("ParticleEmitter", hit)
  473. bloodsplash.Lifetime = NumberRange.new(0.7, 1)
  474. bloodsplash.Speed = NumberRange.new(6)
  475. bloodsplash.SpreadAngle = Vector2.new(-360, 360)
  476. bloodsplash.Rate = 1000
  477. bloodsplash.Size = NumberSequence.new({NumberSequenceKeypoint.new(0, 3), NumberSequenceKeypoint.new(1, 0)})
  478. bloodsplash.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0, 0.2), NumberSequenceKeypoint.new(1, 1)})
  479. bloodsplash.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 255, 255)), ColorSequenceKeypoint.new(1, Color3.fromRGB(0, 0, 0))})
  480. bloodsplash.Texture = "rbxassetid://771221224"
  481. game:GetService("Debris"):AddItem(bloodsplash, 1)
  482. wait(0.25)
  483. bloodsplash.Enabled = false
  484. end
  485. end
  486. end)
  487. for i = 0,1,.15 do
  488. penw.C1 = clerp(penw.C1, penw1 * CFa(0, Rad(-90), 0), i)
  489. neck.C1 = clerp(neck.C1, neck1 * CFa(Rad(-2), 0, 0), i)
  490. rootj.C1 = clerp(rootj.C1, rootj1 * CFn(0, 0, 0.025), i)
  491. LS.C1 = clerp(LS.C1, LS1 * CFa(Rad(-30), 0, Rad(-40)), i)
  492. RS.C1 = clerp(RS.C1, RS1 * CFa(Rad(30), Rad(30), Rad(-3)), i)
  493. LH.C1 = clerp(LH.C1, LH1 * CFn(0, -0.025, 0) * CFa(Rad(5), Rad(-5), 0), i)
  494. RH.C1 = clerp(RH.C1, RH1 * CFn(0, -0.025, 0) * CFa(Rad(5), Rad(5), 0), i)
  495. LS.C0 = clerp(LS.C0, LS0, i)
  496. RS.C0 = clerp(RS.C0, RS0 * CFa(0, 0, Rad(150)), i)
  497. LH.C0 = clerp(LH.C0, LH0, i)
  498. RH.C0 = clerp(RH.C0, RH0, i)
  499. swait()
  500. end
  501. for i = 0,1,.15 do
  502. penw.C1 = clerp(penw.C1, penw1 * CFa(0, Rad(-90), 0), i)
  503. neck.C1 = clerp(neck.C1, neck1 * CFa(Rad(-2), 0, 0), i)
  504. rootj.C1 = clerp(rootj.C1, rootj1 * CFn(0, 0, 0.025), i)
  505. LS.C1 = clerp(LS.C1, LS1 * CFa(Rad(-30), 0, Rad(-40)), i)
  506. RS.C1 = clerp(RS.C1, RS1 * CFa(Rad(-20), Rad(30), Rad(-3)), i)
  507. LH.C1 = clerp(LH.C1, LH1 * CFn(0, -0.025, 0) * CFa(Rad(5), Rad(-5), 0), i)
  508. RH.C1 = clerp(RH.C1, RH1 * CFn(0, -0.025, 0) * CFa(Rad(5), Rad(5), 0), i)
  509. LS.C0 = clerp(LS.C0, LS0, i)
  510. RS.C0 = clerp(RS.C0, RS0 * CFa(0, 0, Rad(20)), i)
  511. LH.C0 = clerp(LH.C0, LH0, i)
  512. RH.C0 = clerp(RH.C0, RH0, i)
  513. swait()
  514. end
  515. hitok = false
  516. hum.WalkSpeed = ws
  517. hum.JumpPower = jp
  518. canattack = true
  519. Stabbing = false
  520. end
  521. end
  522.  
  523. function Throw()
  524. if canattack == true then
  525. Throwing = true
  526. canattack = false
  527. hum.WalkSpeed = 3
  528. hum.JumpPower = 7
  529. ouch = true
  530. for i = 0,1,.15 do
  531. penw.C1 = clerp(penw.C1, penw1 * CFa(0, 0, Rad(-90)), i)
  532. neck.C1 = clerp(neck.C1, neck1 * CFa(Rad(-2), 0, 0), i)
  533. rootj.C1 = clerp(rootj.C1, rootj1 * CFn(0, 0, 0.025), i)
  534. LS.C1 = clerp(LS.C1, LS1 * CFa(Rad(-30), 0, Rad(-40)), i)
  535. RS.C1 = clerp(RS.C1, RS1 * CFa(0, Rad(-30), Rad(-3)), i)
  536. LH.C1 = clerp(LH.C1, LH1 * CFn(0, -0.025, 0) * CFa(Rad(5), Rad(-5), 0), i)
  537. RH.C1 = clerp(RH.C1, RH1 * CFn(0, -0.025, 0) * CFa(Rad(5), Rad(5), 0), i)
  538. LS.C0 = clerp(LS.C0, LS0, i)
  539. RS.C0 = clerp(RS.C0, RS0 * CFa(0, Rad(90), Rad(90)), i)
  540. LH.C0 = clerp(LH.C0, LH0, i)
  541. RH.C0 = clerp(RH.C0, RH0, i)
  542. swait()
  543. end
  544. local throwpen = pen:Clone()
  545. for i,v in pairs(throwpen:GetChildren()) do
  546. if v:IsA("BasePart") and v.CanCollide == true then
  547. v.CanCollide = false
  548. end
  549. end
  550. throwpen.Parent = workspace
  551. local throwbod = throwpen:FindFirstChild("body")
  552. if throwbod:FindFirstChild("penWeld22") then
  553. throwbod:FindFirstChild("penWeld22"):Destroy()
  554. end
  555. local throwbv = Instance.new("BodyVelocity", throwbod)
  556. throwbv.Velocity = mou.Hit.lookVector * 100
  557. throwbv.MaxForce = Vector3.new(100000000000000000, 100000000000000000, 100000000000000000)
  558. throwbod.Touched:connect(function(hit)
  559. if ouch == true and not hit:IsDescendantOf(char) then
  560. ouch = false
  561. throwpen:Destroy()
  562. if hit.Parent:FindFirstChildOfClass("Humanoid") then
  563. local throwhum = hit.Parent:FindFirstChildOfClass("Humanoid")
  564. throwhum.Health = throwhum.Health - dmg
  565. if out == true then
  566. local bloodsound = Instance.new("Sound", hit)
  567. bloodsound.Volume = 10
  568. bloodsound.SoundId = "rbxassetid://180083286"
  569. bloodsound:Play()
  570. game:GetService("Debris"):AddItem(bloodsound, 1)
  571. local bloodsplash = Instance.new("ParticleEmitter", hit)
  572. bloodsplash.Lifetime = NumberRange.new(0.7, 1)
  573. bloodsplash.Speed = NumberRange.new(6)
  574. bloodsplash.SpreadAngle = Vector2.new(-360, 360)
  575. bloodsplash.Rate = 1000
  576. bloodsplash.Size = NumberSequence.new({NumberSequenceKeypoint.new(0, 3), NumberSequenceKeypoint.new(1, 0)})
  577. bloodsplash.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0, 0.2), NumberSequenceKeypoint.new(1, 1)})
  578. bloodsplash.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 255, 255)), ColorSequenceKeypoint.new(1, Color3.fromRGB(0, 0, 0))})
  579. bloodsplash.Texture = "rbxassetid://771221224"
  580. game:GetService("Debris"):AddItem(bloodsplash, 1)
  581. wait(0.25)
  582. bloodsplash.Enabled = false
  583. end
  584. end
  585. if hit.Parent.Parent:FindFirstChildOfClass("Humanoid") then
  586. local throwhum = hit.Parent.Parent:FindFirstChildOfClass("Humanoid")
  587. throwhum.Health = throwhum.Health - dmg
  588. if out == true then
  589. local bloodsound = Instance.new("Sound", hit)
  590. bloodsound.Volume = 10
  591. bloodsound.SoundId = "rbxassetid://180083286"
  592. bloodsound:Play()
  593. game:GetService("Debris"):AddItem(bloodsound, 1)
  594. local bloodsplash = Instance.new("ParticleEmitter", hit)
  595. bloodsplash.Lifetime = NumberRange.new(0.7, 1)
  596. bloodsplash.Speed = NumberRange.new(6)
  597. bloodsplash.SpreadAngle = Vector2.new(-360, 360)
  598. bloodsplash.Rate = 1000
  599. bloodsplash.Size = NumberSequence.new({NumberSequenceKeypoint.new(0, 3), NumberSequenceKeypoint.new(1, 0)})
  600. bloodsplash.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0, 0.2), NumberSequenceKeypoint.new(1, 1)})
  601. bloodsplash.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 255, 255)), ColorSequenceKeypoint.new(1, Color3.fromRGB(0, 0, 0))})
  602. bloodsplash.Texture = "rbxassetid://771221224"
  603. game:GetService("Debris"):AddItem(bloodsplash, 1)
  604. wait(0.25)
  605. bloodsplash.Enabled = false
  606. end
  607. end
  608. end
  609. end)
  610. for i,v in pairs(pen:GetChildren()) do
  611. if v:IsA("BasePart") then
  612. v.Transparency = 1
  613. end
  614. end
  615. for i = 0,1,.1 do
  616. penw.C1 = clerp(penw.C1, penw1 * CFa(0, 0, Rad(-90)), i)
  617. neck.C1 = clerp(neck.C1, neck1 * CFa(Rad(-2), 0, 0), i)
  618. rootj.C1 = clerp(rootj.C1, rootj1 * CFn(0, 0, 0.025) * CFa(Rad(-20), 0, 0), i)
  619. LS.C1 = clerp(LS.C1, LS1 * CFa(Rad(-30), 0, Rad(-40)), i)
  620. RS.C1 = clerp(RS.C1, RS1 * CFa(0, Rad(-30), Rad(-3)), i)
  621. LH.C1 = clerp(LH.C1, LH1 * CFn(0, -0.025, 0) * CFa(Rad(5), Rad(-5), Rad(-20)), i)
  622. RH.C1 = clerp(RH.C1, RH1 * CFn(0, -0.025, 0) * CFa(Rad(5), Rad(5), Rad(-20)), i)
  623. LS.C0 = clerp(LS.C0, LS0, i)
  624. RS.C0 = clerp(RS.C0, RS0 * CFa(0, Rad(-80), Rad(90)), i)
  625. LH.C0 = clerp(LH.C0, LH0, i)
  626. RH.C0 = clerp(RH.C0, RH0, i)
  627. swait()
  628. end
  629. for i = 0,1,.1 do
  630. penw.C1 = clerp(penw.C1, penw1 * CFa(0, 0, Rad(-90)), i)
  631. neck.C1 = clerp(neck.C1, neck1 * CFa(Rad(-30), 0, 0), i)
  632. rootj.C1 = clerp(rootj.C1, rootj1 * CFn(0, 0, 0.025) * CFa(0, 0, Rad(-30)), i)
  633. LS.C1 = clerp(LS.C1, LS1 * CFa(Rad(-30), 0, Rad(-40)), i)
  634. RS.C1 = clerp(RS.C1, RS1 * CFa(0, Rad(-30), Rad(-3)), i)
  635. LH.C1 = clerp(LH.C1, LH1 * CFn(0, -0.025, 0) * CFa(Rad(5), Rad(35), 0), i)
  636. RH.C1 = clerp(RH.C1, RH1 * CFn(0, -0.025, 0) * CFa(Rad(5), Rad(35), 0), i)
  637. LS.C0 = clerp(LS.C0, LS0, i)
  638. RS.C0 = clerp(RS.C0, RS0 * CFn(0, 0, -0.5) * CFa(0, Rad(90), Rad(30)), i)
  639. LH.C0 = clerp(LH.C0, LH0, i)
  640. RH.C0 = clerp(RH.C0, RH0, i)
  641. swait()
  642. end
  643. for i,v in pairs(pen:GetChildren()) do
  644. if v:IsA("BasePart") then
  645. v.Transparency = 0
  646. end
  647. end
  648. hum.WalkSpeed = ws
  649. hum.JumpPower = jp
  650. canattack = true
  651. Throwing = false
  652. end
  653. end
  654.  
  655. -----------------------------------------------------------------------------------
  656.  
  657. function kdown(k)
  658. if k == "e" then
  659. ToggleSharp()
  660. elseif k == "f" then
  661. Throw()
  662. end
  663. end
  664.  
  665. mou.KeyDown:connect(kdown)
  666. mou.Button1Down:connect(Stab)
  667.  
  668. -----------------------------------------------------------------------------------
  669.  
  670. while true do
  671. swait()
  672. sine = sine + 1
  673. rot = rot + 25
  674. if rot == 360 then
  675. rot = 1
  676. end
  677. local torvel = (root.Velocity * Vector3.new(1, 0, 1)).magnitude
  678. if Stabbing == true then
  679. state = "Stabbing"
  680. elseif Throwing == true then
  681. state = "Throwing"
  682. elseif 1 < root.Velocity.y then
  683. state = "Jump"
  684. elseif -1 > root.Velocity.y then
  685. state = "Fall"
  686. elseif torvel < 1 then
  687. state = "Idle"
  688. elseif tor.Velocity.magnitude < 50 then
  689. state = "Walk"
  690. end
  691. if state == "Jump" then
  692. penw.C1 = clerp(penw.C1, penw1 * CFa(0, Rad(-90), 0), 0.15)
  693. neck.C1 = clerp(neck.C1, neck1 * CFa(Rad(-2), 0, 0), 0.15)
  694. rootj.C1 = clerp(rootj.C1, rootj1 * CFa(Rad(-15), 0, 0), 0.15)
  695. LS.C1 = clerp(LS.C1, LS1 * CFa(Rad(10), 0, 0), 0.15)
  696. RS.C1 = clerp(RS.C1, RS1 * CFa(Rad(10), 0, 0), 0.15)
  697. LH.C1 = clerp(LH.C1, LH1 * CFn(0, -0.2, 0) * CFa(Rad(2), 0, Rad(-15)), 0.15)
  698. RH.C1 = clerp(RH.C1, RH1 * CFn(0, -0.5, 0) * CFa(Rad(2), 0, Rad(15)), 0.15)
  699. LS.C0 = clerp(LS.C0, LS0, 0.15)
  700. RS.C0 = clerp(RS.C0, RS0, 0.15)
  701. LH.C0 = clerp(LH.C0, LH0 * CFn(-0.2, 0, 0), 0.15)
  702. RH.C0 = clerp(RH.C0, RH0 * CFn(0.5, 0, 0), 0.15)
  703. elseif state == "Fall" then
  704. penw.C1 = clerp(penw.C1, penw1 * CFa(0, Rad(-90), 0), 0.15)
  705. neck.C1 = clerp(neck.C1, neck1 * CFa(0, 0, 0), 0.15)
  706. rootj.C1 = clerp(rootj.C1, rootj1 * CFa(Rad(15), 0, 0), 0.15)
  707. LS.C1 = clerp(LS.C1, LS1 * CFa(Rad(35), 0, 0), 0.15)
  708. RS.C1 = clerp(RS.C1, RS1 * CFa(Rad(35), 0, 0), 0.15)
  709. LH.C1 = clerp(LH.C1, LH1 * CFn(0.2, -0.2, -0.1) * CFa(Rad(15), 0, Rad(10)), 0.15)
  710. RH.C1 = clerp(RH.C1, RH1 * CFn(-0.2, -0.2, -0.1) * CFa(Rad(15), 0, Rad(-10)), 0.15)
  711. LS.C0 = clerp(LS.C0, LS0, 0.15)
  712. RS.C0 = clerp(RS.C0, RS0, 0.15)
  713. LH.C0 = clerp(LH.C0, LH0 * CFa(0, 0, Rad(-20)), 0.15)
  714. RH.C0 = clerp(RH.C0, RH0 * CFa(0, 0, Rad(20)), 0.15)
  715. elseif state == "Idle" then
  716. penw.C1 = clerp(penw.C1, penw1 * CFn(0, 0, 0.5) * CFa(0, 0, Rad(rot)), 0.15)
  717. neck.C1 = clerp(neck.C1, neck1 * CFa(Rad(-2 * Cos(sine / 15)), 0, 0), 0.15)
  718. rootj.C1 = clerp(rootj.C1, rootj1 * CFn(0, 0, 0.025 * Cos(sine / 15)), 0.15)
  719. LS.C1 = clerp(LS.C1, LS1 * CFa(Rad(-30), 0, Rad(-40)), 0.15)
  720. RS.C1 = clerp(RS.C1, RS1 * CFa(Rad(2), 0, Rad(-3 * Cos(sine / 15))), 0.15)
  721. LH.C1 = clerp(LH.C1, LH1 * CFn(0, -0.025 * Cos(sine / 15), 0) * CFa(Rad(5), Rad(-5), 0), 0.15)
  722. RH.C1 = clerp(RH.C1, RH1 * CFn(0, -0.025 * Cos(sine / 15), 0) * CFa(Rad(5), Rad(5), 0), 0.15)
  723. LS.C0 = clerp(LS.C0, LS0, 0.15)
  724. RS.C0 = clerp(RS.C0, RS0 * CFa(0, 0, Rad(80)), 0.15)
  725. LH.C0 = clerp(LH.C0, LH0, 0.15)
  726. RH.C0 = clerp(RH.C0, RH0, 0.15)
  727. elseif state == "Walk" then
  728. penw.C1 = clerp(penw.C1, penw1 * CFa(0, Rad(-90), 0), 0.15)
  729. neck.C1 = clerp(neck.C1, neck1 * CFa(Rad(-5), 0, 0), 0.15)
  730. rootj.C1 = clerp(rootj.C1, rootj1 * CFn(0, 0.1 * Cos(sine /3), 0.1 * Cos(sine /3)) * CFa(Rad(-5), 0, Rad(5 * Cos(sine / 6))), 0.15)
  731. LS.C1 = clerp(LS.C1, LS1 * CFa(0, 0, Rad(-50 * Cos(sine / 6))), 0.15)
  732. RS.C1 = clerp(RS.C1, RS1 * CFa(0, 0, Rad(-50 * Cos(sine / 6))), 0.15)
  733. LH.C1 = clerp(LH.C1, LH1 * CFa(Rad(2), Rad(-5), Rad(50 * Cos(sine / 6))), 0.15)
  734. RH.C1 = clerp(RH.C1, RH1 * CFa(Rad(2), Rad(5), Rad(50 * Cos(sine / 6))), 0.15)
  735. LS.C0 = clerp(LS.C0, LS0, 0.15)
  736. RS.C0 = clerp(RS.C0, RS0, 0.15)
  737. LH.C0 = clerp(LH.C0, LH0, 0.15)
  738. RH.C0 = clerp(RH.C0, RH0, 0.15)
  739. end
  740. end
Add Comment
Please, Sign In to add comment