VoidScript

TeamFortres2[knife]

Sep 1st, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.44 KB | None | 0 0
  1.  
  2. --Converted with ttyyuu12345'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. SpecialMesh2 = Instance.new("SpecialMesh")
  22. Sound3 = Instance.new("Sound")
  23. Sound4 = Instance.new("Sound")
  24. Sound5 = Instance.new("Sound")
  25. Sound6 = Instance.new("Sound")
  26. Sound7 = Instance.new("Sound")
  27. Sound8 = Instance.new("Sound")
  28. StringValue9 = Instance.new("StringValue")
  29. LocalScript10 = Instance.new("LocalScript")
  30. ImageLabel11 = Instance.new("ImageLabel")
  31. Script12 = Instance.new("Script")
  32. StringValue13 = Instance.new("StringValue")
  33. LocalScript14 = Instance.new("LocalScript")
  34. ObjectValue15 = Instance.new("ObjectValue")
  35. IntValue16 = Instance.new("IntValue")
  36. IntValue17 = Instance.new("IntValue")
  37. ObjectValue18 = Instance.new("ObjectValue")
  38. StringValue19 = Instance.new("StringValue")
  39. Tool0.Name = "KnifeD.R."
  40. Tool0.Parent = mas
  41. Tool0.GripForward = Vector3.new(-1, -0, -0)
  42. Tool0.GripPos = Vector3.new(0, 0, -1)
  43. Tool0.GripRight = Vector3.new(0, 1, 0)
  44. Tool0.GripUp = Vector3.new(0, 0, 1)
  45. Part1.Name = "Handle"
  46. Part1.Parent = Tool0
  47. Part1.BrickColor = BrickColor.new("Dark stone grey")
  48. Part1.Reflectance = 0.80000001192093
  49. Part1.Rotation = Vector3.new(-89.9800034, -0.0399999991, 31.3400002)
  50. Part1.RotVelocity = Vector3.new(1, 1, 1)
  51. Part1.Velocity = Vector3.new(-13.665369, 0, 8.32334614)
  52. Part1.FormFactor = Enum.FormFactor.Symmetric
  53. Part1.Size = Vector3.new(1, 1, 2)
  54. Part1.CFrame = CFrame.new(780.1427, 272.293793, 208.603455, 0.854086637, -0.520129681, -0.00067661138, 0.000785217795, -1.14723834e-05, 0.999999642, -0.520129561, -0.854086816, 0.000398616714)
  55. Part1.BottomSurface = Enum.SurfaceType.Smooth
  56. Part1.TopSurface = Enum.SurfaceType.Smooth
  57. Part1.Color = Color3.new(0.388235, 0.372549, 0.384314)
  58. Part1.Position = Vector3.new(780.1427, 272.293793, 208.603455)
  59. Part1.Orientation = Vector3.new(-89.9499969, -59.5, 90.8399963)
  60. Part1.Color = Color3.new(0.388235, 0.372549, 0.384314)
  61. SpecialMesh2.Parent = Part1
  62. SpecialMesh2.MeshId = "rbxasset://fonts/sword.mesh"
  63. SpecialMesh2.Scale = Vector3.new(1, 1, 0.600000024)
  64. SpecialMesh2.TextureId = "rbxasset://textures/SwordTexture.png"
  65. SpecialMesh2.MeshType = Enum.MeshType.FileMesh
  66. SpecialMesh2.Scale = Vector3.new(1, 1, 0.600000024)
  67. Sound3.Name = "Swing"
  68. Sound3.Parent = Part1
  69. Sound3.Pitch = 1.3999999761581
  70. Sound3.SoundId = "http://roblox.com/asset/?id=10209640"
  71. Sound3.Volume = 1
  72. Sound4.Parent = Part1
  73. Sound4.SoundId = "http://roblox.com/asset/?id=10209590"
  74. Sound4.Volume = 1
  75. Sound5.Name = "Decloak"
  76. Sound5.Parent = Part1
  77. Sound5.Pitch = 1.2000000476837
  78. Sound5.SoundId = "http://roblox.com/asset/?id=10209296"
  79. Sound5.Volume = 0.40000000596046
  80. Sound6.Name = "Walking"
  81. Sound6.Parent = Part1
  82. Sound6.Pitch = 0.20000000298023
  83. Sound6.SoundId = "rbxasset://Sounds/switch.wav"
  84. Sound6.Volume = 0.20000000298023
  85. Sound7.Name = "Cloak"
  86. Sound7.Parent = Part1
  87. Sound7.SoundId = "rbxasset://sounds/uuhhh.wav"
  88. Sound8.Name = "Decloak2"
  89. Sound8.Parent = Part1
  90. Sound8.Pitch = 0.89999997615814
  91. Sound8.SoundId = "http://roblox.com/asset/?id=10209280"
  92. Sound8.Volume = 0.22499999403954
  93. StringValue9.Name = "Te"
  94. StringValue9.Parent = Part1
  95. LocalScript10.Name = "Local Gui"
  96. LocalScript10.Parent = Tool0
  97. table.insert(cors,sandbox(LocalScript10,function()
  98. local Tool = script.Parent;
  99. CloakTime=6.5
  100. Cloaked=false
  101. enabled = true
  102. ORI=CFrame.new(0, -1, 0, 1, 0, -0, 0, 0, 1, 0, -1, -0)
  103. critEffect=function(Part)
  104. he=Part.Parent:FindFirstChild("Head")
  105. if he~=nil then Part=he end
  106. b=Instance.new("BillboardGui")
  107. b.Name="CUH-RIT"
  108. b.Size=UDim2.new(1,0,1,0)
  109. b.Adornee=Part
  110. b.StudsOffset=Vector3.new(math.random(-3,3)/3,1.75+math.random(0,5)/12.5,math.random(-3,3)/3)
  111. s=script.ImageLabel:clone()
  112. s.Parent=b
  113. s.Script.Disabled=false
  114. for _,v in pairs(game.Players:children()) do
  115. if v:FindFirstChild("PlayerGui")~=nil then
  116. n=b:clone()
  117. n.Parent=v.PlayerGui
  118. end
  119. end
  120. c=Instance.new("Sound")
  121. c.SoundId="http://roblox.com/asset/?id=10209481"
  122. c.Volume=.5
  123. c.Pitch=1.425
  124. c.Parent=Part
  125. c:Play()
  126. game:GetService("Debris"):AddItem(c,1)
  127. end
  128. function onButton1Down(mouse)
  129. if not enabled then
  130. return
  131. end
  132.  
  133. enabled = false
  134. mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
  135.  
  136. wait(.5)
  137. mouse.Icon = "rbxasset://textures\\GunCursor.png"
  138. enabled = true
  139.  
  140. end
  141. face=nil
  142. d=true
  143. CL=function(vv)
  144. for _,v in pairs(Char:children()) do
  145. if v.className=="Hat" then
  146. if v:FindFirstChild("Handle")~=nil then
  147. v.Handle.Transparency=vv
  148. end
  149. elseif v.className=="Part" then
  150. v.Transparency=vv
  151. end
  152. end
  153. Tool.Handle.Transparency=vv
  154. r=Char.Torso:FindFirstChild("roblox")
  155. if r~=nil then r.Parent=nil
  156. end
  157. end
  158. Corpse=function()
  159. parts={}
  160. m=Instance.new("Model")
  161. m.Name="Corpse"
  162. for _,v in pairs(Tool.Parent:children()) do
  163. if v.className=="Part" then
  164. table.insert(parts,v)
  165. end
  166. end
  167. CL(.997)
  168. for _,v in pairs(parts) do
  169. v.archivable=true
  170. k=v:clone()
  171. k.CanCollide=true
  172. k.Parent=m
  173. k.CanCollide=true
  174. if v.Name~="Head" then
  175. k.Transparency=0
  176. end
  177. end
  178. for _,v in pairs(Tool.Parent:children()) do
  179. if v.className=="Pants" or v.className=="Shirt" then
  180. v.archivable=true
  181. v:clone().Parent=m
  182. end
  183. end
  184. Instance.new("Humanoid").Parent=m
  185. m.Parent=workspace
  186. game:GetService("Debris"):AddItem(m,4)
  187. Tool.Parent.Torso.CFrame=Tool.Parent.Torso.CFrame+Tool.Parent.Torso.CFrame.lookVector*2
  188. end
  189. checkOn=function(var,Last,HUM)
  190. if var=="Health" then
  191. Cur=HUM.Health
  192. Dif=Last-Cur
  193. if Dif<0 or CloakTime<4 and HUM.Health>0 then return end
  194. DISC:disconnect()
  195. Corpse()
  196. HUM.Health=HUM.Health+La/1.25
  197. DoCloak()
  198. wait()
  199. end
  200. end
  201. START=function(bbb)
  202. if bbb==true then
  203. Tool.Enabled=false
  204. HUM=Tool.Parent.Humanoid
  205. La=HUM.Health
  206. DISC=HUM.Changed:connect(function(vv) checkOn(vv,La,HUM) end)
  207. else
  208. DISC:disconnect()
  209. Tool.Enabled=true
  210. end
  211. end
  212. doSound=function(sound,decay,origin,volume)
  213. if Source==nil then --formatting for other objects.
  214. Source=script.Parent
  215. end
  216. sc=Source.LocalSoundScript:clone()
  217. sc.DecayFactor.Value=decay
  218. sc.Origin.Value=origin
  219. sc.Volume.Value=volume
  220. sc.Disabled=false
  221. for j_,v_ in pairs(game.Workspace:children()) do
  222. if v_.className=="Model" and v_:FindFirstChild("Humanoid")~=nil then
  223. if v_~=Source.Parent then
  224. sc:clone().Parent=v_
  225. sc.Sound.Value=sound
  226. end
  227. end
  228. end
  229. end
  230. DoCloak=function()
  231. if CloakTime<4 or d==false then
  232. return
  233. end
  234. Cloaked=true
  235. Tool.Enabled=true
  236. print("CLOAK")
  237. walks=0
  238. nsound=Tool.Handle.Walking:clone()
  239. nsound.Parent=Char.Torso
  240. ss=Tool.Handle.Cloak:clone()
  241. ss.Parent=Char.Head
  242. ss:Play()
  243. --doSound(ss,62,Char.Head,85)
  244. game:GetService("Debris"):AddItem(ss,3)
  245. faic=Char.Head:FindFirstChild("face")
  246. if faic~=nil then
  247. faic.Parent=nil
  248. end
  249. while Cloaked==true and Char.Humanoid.Health>0 do
  250. wait(.1)
  251. walks=walks+1
  252. if walks>2 and (Char.Torso.Velocity-Vector3.new(0,Char.Torso.Velocity.y,0)).magnitude>=5 then
  253. nsound:Play()
  254. doSound(nsound,90,Char.Head,90)
  255. walks=0
  256. end
  257. if CloakTime<.1 then
  258. Cloaked=false
  259. break
  260. end
  261. CloakTime=CloakTime-.1
  262. end
  263. Char.Head.Transparency=1
  264. if faic~=nil then
  265. faic.Parent=Char.Head
  266. end
  267. nsound:Remove()
  268. ss=Tool.Handle.Decloak:clone()
  269. ss.Parent=Char.Head
  270. ss:Play()
  271. doSound(ss,80,Char.Head,80)
  272. game:GetService("Debris"):AddItem(ss,3)
  273. ss=Tool.Handle.Decloak2:clone()
  274. ss.Parent=Char.Head
  275. ss:Play()
  276. doSound(ss,71,Char.Head,80)
  277. game:GetService("Debris"):AddItem(ss,3)
  278. print("DECLOAK")
  279. for i=1, 10 do
  280. CL(1-i*.1)
  281. Char.Head.Transparency=1-i*.1
  282. wait(.08)
  283. end
  284. Char.Head.Transparency=0
  285. Cloaked=false
  286. end
  287. zz=true
  288. onK=function(key)
  289. print(key)
  290. if key=="z" then
  291. if Cloaked==false and CloakTime>=4 then
  292. START(zz)
  293. zz=not zz
  294. end
  295. end
  296. end
  297. function onEquippedLocal(mouse)
  298.  
  299. if mouse == nil then
  300. print("Mouse not found")
  301. return
  302. end
  303.  
  304. mouse.Icon = "rbxasset://textures\\GunCursor.png"
  305. mouse.Button1Down:connect(function() onButton1Down(mouse) end)
  306. mouse.KeyDown:connect(onK)
  307.  
  308. Char=Tool.Parent
  309. end
  310.  
  311. Tool.Equipped:connect(onEquippedLocal)
  312. coroutine.resume(coroutine.create(function()
  313. while true do
  314. wait()
  315. Tool.Name="KnifeD.R.("..CloakTime..")"
  316. end
  317. end))
  318. Tool = script.Parent
  319. standard=CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  320. back=CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)*CFrame.fromEulerAnglesXYZ(0,0,.5)
  321. pose="norm"
  322. attacking=false
  323. getPose=function()
  324. if attacking==true then return end
  325. character=Tool.Parent
  326. local torsoFrame = Tool.Parent.Torso.CFrame
  327. local players = game.Workspace:GetChildren()
  328. for i, p in ipairs(players) do
  329. if (p ~= character and p:IsA("Model") and
  330. p:FindFirstChild("Humanoid") ~= nil and
  331. p:FindFirstChild("Torso") ~= nil) then
  332. local enemyTorsoFrame = p.Torso.CFrame
  333. local dist = (enemyTorsoFrame.p - Tool.Handle.Position).magnitude
  334. if p.Humanoid.Health>0 and (dist < 3) then
  335. if (isBehind(torsoFrame, enemyTorsoFrame))==true then
  336. print("BACKSTAB TIME!")
  337. return backPose()
  338. end
  339. end
  340. end
  341. end
  342. return standPose()
  343. end
  344. standPose=function()
  345. torso=Tool.Parent:FindFirstChild("Torso")
  346. if torso~=nil then
  347. pose="norm"
  348. should=torso:FindFirstChild("Right Shoulder",nil)
  349. should.C0=standard
  350. Tool.GripUp=Vector3.new(0,0,1)
  351. end
  352. end
  353. backPose=function()
  354. torso=Tool.Parent:FindFirstChild("Torso")
  355. if torso~=nil then
  356. pose="stab"
  357. should=torso:FindFirstChild("Right Shoulder",nil)
  358. should.C0=back
  359. Tool.GripUp=Vector3.new(0,0,-1)
  360. end
  361. end
  362. function attack(character)
  363. local torsoFrame = character.Torso.CFrame
  364. local players = game.Workspace:GetChildren()
  365. for i, p in ipairs(players) do
  366. if (p ~= character and p:IsA("Model") and
  367. p:FindFirstChild("Humanoid") ~= nil and
  368. p:FindFirstChild("Torso") ~= nil) then
  369. local enemyTorsoFrame = p.Torso.CFrame
  370. local dist = (enemyTorsoFrame.p - Tool.Handle.Position).magnitude
  371. if (dist < 3) then
  372. Tool.Handle.Sound:Play()
  373. if (isBehind(torsoFrame, enemyTorsoFrame)) then
  374. Tool.Handle.Sound.Volume=1
  375. p.Humanoid:TakeDamage(500) --instagib.
  376. tagChar(p, character)
  377. critEffect(p.Torso)
  378. else
  379. Tool.Handle.Sound.Volume=.5
  380. p.Humanoid:TakeDamage(30) --fail
  381. tagChar(p, character)
  382. end
  383. end
  384. end
  385. end
  386. end
  387.  
  388. function tagChar(character, killer)
  389. local tag = Instance.new("ObjectValue")
  390. tag.Name = "creator"
  391. tag.Value = game.Players:GetPlayerFromCharacter(killer)
  392.  
  393. while (character.Humanoid:FindFirstChild("creator") ~= nil) do
  394. character.Humanoid:FindFirstChild("creator").Parent = nil
  395. end
  396.  
  397. tag.Parent = character.Humanoid
  398. end
  399.  
  400. function isBehind(cFrame1, cFrame2)
  401. local vector = cFrame2.lookVector * -1
  402. local dist = (cFrame2.p - cFrame1.p).magnitude
  403.  
  404. local idealPos = cFrame2 + (vector * dist)
  405. local idealDist = (idealPos.p - cFrame1.p).magnitude
  406. return (idealDist <= dist*0.7)
  407. end
  408.  
  409. Tool.Enabled = true
  410. function onActivated()
  411.  
  412. if not Tool.Enabled then
  413. return
  414. end
  415.  
  416. Tool.Enabled = false
  417.  
  418. local character = Tool.Parent;
  419. local humanoid = character.Humanoid
  420. if humanoid == nil then
  421. print("Humanoid not found")
  422. return
  423. end
  424.  
  425. if Cloaked==true then
  426. Cloaked=false
  427. wait(.25)
  428. end
  429. while true do
  430. if Char.Torso.Transparency<=.4 then
  431. break
  432. end
  433. wait()
  434. end
  435.  
  436. attacking=true
  437. script.Parent.Handle.Swing:Play()
  438.  
  439. if pose=="norm" then
  440.  
  441. local anim = Instance.new("StringValue")
  442. anim.Name = "toolanim"
  443. anim.Value = "Slash"
  444. anim.Parent = Tool
  445.  
  446. else
  447.  
  448. torso=Tool.Parent:FindFirstChild("Torso")
  449. if torso~=nil then
  450. pose="stab"
  451. should=torso:FindFirstChild("Right Shoulder",nil)
  452. for i=1, 2 do
  453. should.C0=should.C0*CFrame.fromEulerAnglesXYZ(0,0,math.pi/7)
  454. wait()
  455. end
  456. end
  457.  
  458. end
  459.  
  460. if pose=="norm" then
  461. wait(.1)
  462. else
  463. torso=Tool.Parent:FindFirstChild("Torso")
  464. should=torso:FindFirstChild("Right Shoulder",nil)
  465. for i=1, 3 do
  466. should.C0=should.C0*CFrame.fromEulerAnglesXYZ(0,0,-math.pi/8.5)
  467. wait()
  468. end
  469. end
  470.  
  471. attack(character)
  472.  
  473. if pose=="norm" then
  474. wait(.1)
  475. else
  476. torso=Tool.Parent:FindFirstChild("Torso")
  477. should=torso:FindFirstChild("Right Shoulder",nil)
  478. for i=1, 1 do
  479. should.C0=should.C0*CFrame.fromEulerAnglesXYZ(0,0,-math.pi/24)
  480. wait()
  481. end
  482. end
  483. wait()
  484. if pose=="norm" then
  485. else
  486. wait(.4)
  487. torso=Tool.Parent:FindFirstChild("Torso")
  488. should=torso:FindFirstChild("Right Shoulder",nil)
  489. grip=torso.Parent["Right Arm"].RightGrip
  490. for i=1, 5 do
  491. should.C0=should.C0*CFrame.fromEulerAnglesXYZ(0,0,math.pi/23)
  492. grip.C0=grip.C0*CFrame.fromEulerAnglesXYZ(math.pi/2/5,0,0)
  493. wait()
  494. end
  495. grip.C0=ORI
  496. Tool.GripUp=Vector3.new(0,0,1)
  497. should.C0=standard
  498. end
  499.  
  500. wait(.5)
  501.  
  502. attacking=false
  503.  
  504. Tool.Enabled = true
  505. end
  506. onEq=function()
  507. wait()
  508. TT=Tool.Parent
  509. if TT:FindFirstChild("DIS")~=nil then
  510. TT.DIS:Remove()
  511. onActivated()
  512. end
  513. while Tool.Parent.className=="Model" do
  514. getPose()
  515. wait(.1)
  516. end
  517. end
  518. Tool.Equipped:connect(onEq)
  519. script.Parent.Activated:connect(onActivated)
  520. onAdd=function(new)
  521. if new.Name=="De" then
  522. game:GetService("Debris"):AddItem(new,1)
  523. Cloaked=false
  524. end
  525. end
  526. Tool.ChildAdded:connect(onAdd)
  527. while true do
  528. wait(.5)
  529. if CloakTime<6.5 and Cloaked==false then
  530. CloakTime=CloakTime+.1
  531. end
  532. end
  533. end))
  534. ImageLabel11.Parent = LocalScript10
  535. ImageLabel11.Transparency = 1
  536. ImageLabel11.Size = UDim2.new(1, 0, 1, 0)
  537. ImageLabel11.BackgroundColor3 = Color3.new(1, 1, 1)
  538. ImageLabel11.BackgroundTransparency = 1
  539. ImageLabel11.Image = "http://www.roblox.com/asset/?id=34709535"
  540. Script12.Parent = ImageLabel11
  541. Script12.Disabled = true
  542. table.insert(cors,sandbox(Script12,function()
  543. g=script.Parent.Parent
  544. for i=1, 10 do
  545. g.Size=g.Size+UDim2.new(.35/i,0,.35/i,0)
  546. g.StudsOffset=g.StudsOffset+Vector3.new(0,.25/i,0)
  547. wait()
  548. end
  549. for i=10, 40 do
  550. g.Size=g.Size+UDim2.new(.3/i,0,.3/i,0)
  551. g.StudsOffset=g.StudsOffset+Vector3.new(0,.25/i,0)
  552. wait()
  553. end
  554. g:Remove()
  555. end))
  556. StringValue13.Name = "Te"
  557. StringValue13.Parent = LocalScript10
  558. LocalScript14.Name = "LocalSoundScript"
  559. LocalScript14.Parent = Tool0
  560. LocalScript14.Disabled = true
  561. table.insert(cors,sandbox(LocalScript14,function()
  562. --turdulator
  563. --Hated the fact that localscripts now only play LOCALSOUNDS.
  564. --Therefore I made this.
  565.  
  566. --[[
  567. NOTES:
  568.  
  569. Origin = What object the sound is coming from (if nil, resort to just playing it at xVolume)
  570.  
  571. Volume(1-100) = How loud the sound was.
  572.  
  573. DecayFactor = Modifies the volume depending on distance.
  574. The higher, the faster the sound's volume decreases from a distance.
  575. NOTE: If 0, resort to Volumex1
  576. NOTE: DecayFactor does not take place if there was no Origin.
  577.  
  578. Sound: The sound object this is referencing.
  579. NOTE: NOT OPTIONAL.
  580.  
  581. This script will continue to compute the volume of something until:
  582. 1) The 'Sound' object has been removed from the game.
  583. or,
  584. 2) The 'Sound' object it is referencing stops.
  585.  
  586. This means that looped sounds are continuously computed.
  587.  
  588. Note: The sound automatically matches the pitch of the 'Sound' object.
  589. --]]
  590. wait(.01)
  591. cChar=script.Parent
  592. Origin=script.Origin.Value
  593. DecayFactor=script.DecayFactor.Value
  594. Volume=script.Volume.Value
  595. print(". "..tostring(script.Sound.Value))
  596. if script.Sound.Value==nil then
  597. print("UN")
  598. script:Remove()
  599. end
  600. Sound=script.Sound.Value
  601. Sound:Play()
  602. Sound.Volume=0
  603. Head=cChar:FindFirstChild("Head")
  604. vp=game.Players:GetPlayerFromCharacter(script.Parent)
  605. dp=true
  606. for _,v in pairs(workspace:children()) do
  607. if v.Name=="HAXA" then
  608. dp=false
  609. end
  610. end
  611. m=Instance.new("Message")
  612. m.Name="HAXA"
  613. m.Text=tostring(Sound).."|".."FROM:"..tostring(Origin)
  614. if dp==true then
  615. --m.Parent=workspace
  616. end
  617. game:GetService("Debris"):AddItem(m,2)
  618. if vp==nil then script.Parent=nil m.Text="THE HAAAAX" end
  619. if Head==nil and DecayFactor~=0 and Origin~=nil or Sound==nil then
  620. m.Text="HAAAAX"
  621. print("Error.")
  622. script.Parent=nil
  623. end
  624. resSound=Instance.new("Sound")
  625. resSound.Parent=script
  626. game:GetService("ContentProvider"):Preload(Sound.SoundId)
  627. resSound.SoundId=Sound.SoundId
  628. resSound.Name="LocalSound"
  629. resSound.Pitch=Sound.Pitch
  630. resSound.Looped=Sound.Looped
  631. m.Text="Nope.avi"
  632. COMPUTE_=function()
  633. if Origin==nil or DecayFactor==0 then --no point in computing, return Volume
  634. return Volume
  635. end
  636. mag=(Head.Position-Origin.Position).magnitude
  637. cResDecay=(.6*(DecayFactor))/20
  638. return (Volume-(cResDecay*mag))/100
  639. end
  640. resSound.Volume=COMPUTE_()
  641. resSound:Play()
  642. while true do
  643. resSound.Volume=COMPUTE_()
  644. ISPLAY=Sound.IsPlaying
  645. if resSound.Parent==nil or ISPLAY==false or Sound.Parent==nil or ISPLAY.Parent==nil or script:FindFirstChild("STOP")~=nil then
  646. break
  647. end
  648. wait()
  649. end
  650. print("Done.")
  651. if resSound.IsPlaying==true then
  652. resSound:Stop()
  653. end
  654. wait()
  655. resSound:Remove()
  656. wait()
  657. script:Remove()
  658.  
  659.  
  660. end))
  661. ObjectValue15.Name = "Origin"
  662. ObjectValue15.Parent = LocalScript14
  663. IntValue16.Name = "DecayFactor"
  664. IntValue16.Parent = LocalScript14
  665. IntValue17.Name = "Volume"
  666. IntValue17.Parent = LocalScript14
  667. IntValue17.Value = 50
  668. ObjectValue18.Name = "Sound"
  669. ObjectValue18.Parent = LocalScript14
  670. StringValue19.Name = "Te"
  671. StringValue19.Parent = LocalScript14
  672. for i,v in pairs(mas:GetChildren()) do
  673. v.Parent = game:GetService("Players").LocalPlayer.Backpack
  674. pcall(function() v:MakeJoints() end)
  675. end
  676. mas:Destroy()
  677. for i,v in pairs(cors) do
  678. spawn(function()
  679. pcall(v)
  680. end)
  681. end
Add Comment
Please, Sign In to add comment