Offsetchain

Lua Pen

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