Advertisement
XDMANFROMXDWORLD

ROBLOX Pen FE

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