Advertisement
Guest User

Untitled

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