Advertisement
Theskyler900

test knife

Aug 5th, 2017
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.42 KB | None | 0 0
  1.  
  2. --Converted with PenguinAnonymous's model to script plugin v4
  3. function sandbox(var,func)
  4. local env = getfenv(func)
  5. local newenv = setmetatable({},{
  6. __index = function(self,k)
  7. if k=="script" then
  8. return var
  9. else
  10. return env[k]
  11. end
  12. end,
  13. })
  14. setfenv(func,newenv)
  15. return func
  16. end
  17. cors = {}
  18. mas = Instance.new("Model",game:GetService("Lighting"))
  19. Tool0 = Instance.new("Tool")
  20. Part1 = Instance.new("Part")
  21. Sound2 = Instance.new("Sound")
  22. SpecialMesh3 = Instance.new("SpecialMesh")
  23. LocalScript4 = Instance.new("LocalScript")
  24. Script5 = Instance.new("Script")
  25. Script6 = Instance.new("Script")
  26. Script7 = Instance.new("Script")
  27. Tool0.Name = "Autistic Shuriken"
  28. Tool0.Parent = mas
  29. Tool0.TextureId = "rbxassetid://836025023"
  30. Tool0.GripForward = Vector3.new(-0.371201903, 0.00935677905, -0.928505063)
  31. Tool0.GripPos = Vector3.new(-0.600000024, 0, 0.699999988)
  32. Tool0.GripRight = Vector3.new(-0.00347340619, -0.99995625, -0.00868819654)
  33. Tool0.GripUp = Vector3.new(0.928545654, 0, -0.371218145)
  34. Tool0.ToolTip = "Even autistic people can be ninjas."
  35. Part1.Name = "Handle"
  36. Part1.Parent = Tool0
  37. Part1.Position = Vector3.new(20.5010128, 2.19976997, 4.5)
  38. Part1.Rotation = Vector3.new(-180, 0, -179.970001)
  39. Part1.FormFactor = Enum.FormFactor.Plate
  40. Part1.Size = Vector3.new(1, 0.400000006, 1)
  41. Part1.CFrame = CFrame.new(20.5010128, 2.19976997, 4.5, -0.999999821, 0.0004594778, 5.96046448e-08, 0.000459477829, 0.999999881, 2.03726813e-10, -8.94069672e-08, 2.32830644e-10, -0.999999881)
  42. Part1.BottomSurface = Enum.SurfaceType.Smooth
  43. Part1.TopSurface = Enum.SurfaceType.Smooth
  44. Part1.Position = Vector3.new(20.5010128, 2.19976997, 4.5)
  45. Part1.Orientation = Vector3.new(0, 180, 0.0299999993)
  46. Sound2.Name = "Fire"
  47. Sound2.Parent = Part1
  48. Sound2.SoundId = "rbxassetid://849861238"
  49. Sound2.Volume = 10
  50. SpecialMesh3.Parent = Part1
  51. SpecialMesh3.MeshId = "rbxassetid://482238802"
  52. SpecialMesh3.Scale = Vector3.new(2.29999995, 1.10000002, 1.10000002)
  53. SpecialMesh3.TextureId = "rbxassetid://552099844"
  54. SpecialMesh3.MeshType = Enum.MeshType.FileMesh
  55. SpecialMesh3.Scale = Vector3.new(2.29999995, 1.10000002, 1.10000002)
  56. LocalScript4.Name = "Local Gui"
  57. LocalScript4.Parent = Tool0
  58. table.insert(cors,sandbox(LocalScript4,function()
  59. Tool=script.Parent
  60. function onEquippedLocal(mouse)
  61. if mouse == nil then
  62. print("Mouse not found")
  63. return
  64. end
  65. mouse.Icon = "rbxasset://textures\\GunCursor.png"
  66. end
  67.  
  68. Tool.Equipped:connect(onEquippedLocal)
  69.  
  70. -- Autistic Shuriken created by SlenderMadMan
  71. end))
  72. Script5.Name = "BrickCleanup"
  73. Script5.Parent = Tool0
  74. Script5.Disabled = true
  75. table.insert(cors,sandbox(Script5,function()
  76. -- this script removes its parent from the workspace after 24 seconds
  77. s = script.Parent
  78. wait(15)
  79. s.Transparency = .1
  80. wait(.2)
  81. s.Transparency = .2
  82. wait(.2)
  83. s.Transparency = .3
  84. wait(.2)
  85. s.Transparency = .4
  86. wait(.2)
  87. s.Transparency = .5
  88. wait(.2)
  89. s.Transparency = .6
  90. wait(.2)
  91. s.Transparency = .7
  92. wait(.2)
  93. s.Transparency = .8
  94. wait(.2)
  95. script.Parent.Parent = nil
  96.  
  97. end))
  98. Script6.Name = "StarScript"
  99. Script6.Parent = Tool0
  100. Script6.Disabled = true
  101. table.insert(cors,sandbox(Script6,function()
  102. arrow = script.Parent
  103. damage = 23
  104.  
  105. local HitSound = Instance.new("Sound")
  106. HitSound.SoundId = "http://www.roblox.com/asset/?id=157878578"
  107. HitSound.Parent = arrow
  108. HitSound.Volume = 6
  109.  
  110. function stick(hit)
  111. -- joint myself to the thing i hit
  112.  
  113. local weld = Instance.new("Weld")
  114.  
  115. weld.Part0 = arrow
  116. weld.Part1 = hit
  117.  
  118. -- correction term to account for average skew between physics update and heartbeat
  119. local HitPos = arrow.Position --+ (-arrow.Velocity * (1/60)) --+ (arrow.CFrame.lookVector * .5)
  120.  
  121. local CJ = CFrame.new(HitPos)
  122. local C0 = arrow.CFrame:inverse() *CJ
  123. local C1 = hit.CFrame:inverse() * CJ
  124.  
  125. weld.C0 = C0
  126. weld.C1 = C1
  127.  
  128. weld.Parent = arrow
  129.  
  130. end
  131.  
  132.  
  133. function onTouched(hit)
  134.  
  135. connection:disconnect()
  136.  
  137. HitSound:Play()
  138.  
  139. humanoid = hit.Parent:findFirstChild("Humanoid")
  140. if humanoid~=nil then
  141. local s = Instance.new("Part")
  142. s.formFactor = 2 -- plate
  143. s.Size = Vector3.new(1,.4,1)
  144. s.BrickColor = BrickColor.new("Bright red")
  145. local v = Vector3.new(math.random(-1,1), math.random(0,1), math.random(-1,1))
  146. s.Velocity = 15 * v
  147. s.CFrame = CFrame.new(arrow.Position + v, v)
  148. arrow.BrickCleanup:clone().Parent = s
  149. s.BrickCleanup.Disabled = false
  150. s.Parent = game.Workspace
  151.  
  152. tagHumanoid(humanoid)
  153. humanoid:TakeDamage(damage)
  154. wait(1)
  155. untagHumanoid(humanoid)
  156. else
  157. stick(hit)
  158. end
  159.  
  160. end
  161.  
  162. function tagHumanoid(humanoid)
  163. -- todo: make tag expire
  164. local tag = arrow:findFirstChild("creator")
  165. if tag ~= nil then
  166. local new_tag = tag:clone()
  167. new_tag.Parent = humanoid
  168.  
  169. end
  170. end
  171.  
  172.  
  173. function untagHumanoid(humanoid)
  174. if humanoid ~= nil then
  175. local tag = humanoid:findFirstChild("creator")
  176. if tag ~= nil then
  177.  
  178. tag.Parent = nil
  179. end
  180. end
  181. end
  182.  
  183. connection = arrow.Touched:connect(onTouched)
  184.  
  185. wait(2)
  186.  
  187. arrow.Parent = nil
  188. end))
  189. Script7.Name = "NinjaStar"
  190. Script7.Parent = Tool0
  191. table.insert(cors,sandbox(Script7,function()
  192. Tool = script.Parent
  193. VELOCITY = 50 -- constant
  194. loaded=false
  195.  
  196. local Pellet = Instance.new("Part")
  197. Pellet.Name="NinjaStar"
  198. Pellet.Locked = true
  199. Pellet.BackSurface = 0
  200. Pellet.BottomSurface = 0
  201. Pellet.FrontSurface = 0
  202. Pellet.LeftSurface = 0
  203. Pellet.RightSurface = 0
  204. Pellet.TopSurface = 0
  205. Pellet.Shape = 1
  206. Pellet.formFactor = 2
  207. Pellet.Size = Vector3.new(1,.4,1)
  208. Pellet.BrickColor = BrickColor.new(26)
  209. script.Parent.StarScript:clone().Parent = Pellet
  210.  
  211.  
  212.  
  213. function fire(v)
  214. Tool.Parent.Torso["Right Shoulder"].MaxVelocity = 0.7
  215. Tool.Parent.Torso["Right Shoulder"].DesiredAngle = 3.6
  216. wait(.1)
  217. Tool.Parent.Torso["Right Shoulder"].MaxVelocity = 1
  218. Tool.Handle.Transparency=1
  219. Tool.Handle.Fire:play()
  220.  
  221. -- find player's head pos
  222.  
  223. local vCharacter = Tool.Parent
  224. local vPlayer = game.Players:playerFromCharacter(vCharacter)
  225.  
  226. local head = vCharacter:findFirstChild("Head")
  227. if head == nil then return end
  228.  
  229.  
  230. local launch = head.Position + 10 * v
  231.  
  232.  
  233.  
  234. local missile = Pellet:clone()
  235.  
  236.  
  237. Tool.Handle.Mesh:clone().Parent = missile
  238.  
  239.  
  240. missile.Position = launch
  241. missile.Velocity = v * 150
  242.  
  243. local force = Instance.new("BodyForce")
  244. force.force = Vector3.new(0,40,0)
  245. force.Parent = missile
  246.  
  247. missile.StarScript.Disabled = false
  248.  
  249. local creator_tag = Instance.new("ObjectValue")
  250. creator_tag.Value = vCharacter
  251. creator_tag.Name = "creator"
  252. creator_tag.Parent = missile
  253.  
  254. bc = script.Parent.BrickCleanup
  255. bc:clone().Parent = missile
  256.  
  257. missile.Parent = game.Workspace
  258.  
  259. end
  260.  
  261.  
  262.  
  263.  
  264.  
  265. Tool.Enabled = true
  266. function onActivated()
  267. if not Tool.Enabled then
  268. return
  269. end
  270.  
  271. Tool.Enabled = false
  272.  
  273. local character = Tool.Parent;
  274. local humanoid = character.Humanoid
  275. if humanoid == nil then
  276. print("Humanoid not found")
  277. return
  278. end
  279. if loaded==true then
  280. loaded=false
  281.  
  282. local targetPos = humanoid.TargetPoint
  283. local lookAt = (targetPos - character.Head.Position).unit
  284.  
  285. fire(lookAt)
  286.  
  287. wait(.3)
  288.  
  289. Tool.Enabled = true
  290. elseif loaded==false then
  291. Tool.Parent.Torso["Right Shoulder"].MaxVelocity = 0.6
  292. Tool.Parent.Torso["Right Shoulder"].DesiredAngle = -3.6
  293. wait(.1)
  294. Tool.Handle.Transparency=0
  295. wait(.1)
  296. loaded=true
  297. end
  298. Tool.Enabled = true
  299. end
  300.  
  301. script.Parent.Activated:connect(onActivated)
  302.  
  303. end))
  304. for i,v in pairs(mas:GetChildren()) do
  305. v.Parent = workspace
  306. pcall(function() v:MakeJoints() end)
  307. end
  308. mas:Destroy()
  309. for i,v in pairs(cors) do
  310. spawn(function()
  311. pcall(v)
  312. end)
  313. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement