Advertisement
igdegoo

Ting Script

Nov 8th, 2017
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 8.03 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. Sound2 = Instance.new("Sound")
  22. SpecialMesh3 = Instance.new("SpecialMesh")
  23. Weld4 = Instance.new("Weld")
  24. Weld5 = Instance.new("Weld")
  25. Sound6 = Instance.new("Sound")
  26. Script7 = Instance.new("Script")
  27. LocalScript8 = Instance.new("LocalScript")
  28. Script9 = Instance.new("Script")
  29. Script10 = Instance.new("Script")
  30. Tool0.Name = "Ting"
  31. Tool0.Parent = mas
  32. Tool0.GripForward = Vector3.new(-0, 6.00000021e-05, -1)
  33. Tool0.GripPos = Vector3.new(0, -0.200000003, -0.5)
  34. Tool0.GripUp = Vector3.new(0, 1, 6.00000021e-05)
  35. Part1.Name = "Handle"
  36. Part1.Parent = Tool0
  37. Part1.BrickColor = BrickColor.new("Black")
  38. Part1.RotVelocity = Vector3.new(7.38069024e-18, -1.40138574e-17, 4.40040608e-08)
  39. Part1.Velocity = Vector3.new(-4.46693704e-09, 0.00487950863, 2.47418787e-17)
  40. Part1.FormFactor = Enum.FormFactor.Symmetric
  41. Part1.Size = Vector3.new(1, 1, 2)
  42. Part1.CFrame = CFrame.new(1.5, 0.490971088, 1.7640066e-19, 1, -9.00066954e-09, -5.88002049e-20, 9.00066954e-09, 1, -1.96940413e-18, 5.88002179e-20, 1.96940413e-18, 1)
  43. Part1.BottomSurface = Enum.SurfaceType.Smooth
  44. Part1.TopSurface = Enum.SurfaceType.Smooth
  45. Part1.Color = Color3.new(0.105882, 0.164706, 0.207843)
  46. Part1.Position = Vector3.new(1.5, 0.490971088, 1.7640066e-19)
  47. Part1.Color = Color3.new(0.105882, 0.164706, 0.207843)
  48. Sound2.Name = "Reload"
  49. Sound2.Parent = Part1
  50. Sound2.Pitch = 0.5
  51. Sound2.SoundId = "rbxasset://sounds/uuhhh.wav"
  52. Sound2.Volume = 2
  53. SpecialMesh3.Parent = Part1
  54. SpecialMesh3.MeshId = "http://www.roblox.com/asset/?id=3824738"
  55. SpecialMesh3.Scale = Vector3.new(3, 3, 3)
  56. SpecialMesh3.TextureId = "rbxassetid://3824735"
  57. SpecialMesh3.MeshType = Enum.MeshType.FileMesh
  58. SpecialMesh3.Scale = Vector3.new(3, 3, 3)
  59. Weld4.Parent = Part1
  60. Weld4.C1 = CFrame.new(3, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  61. Weld5.Parent = Part1
  62. Weld5.C1 = CFrame.new(3, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  63. Weld5.Part0 = Part1
  64. Weld5.Part1 = nil
  65. Sound6.Name = "Skrraa"
  66. Sound6.Parent = Part1
  67. Sound6.SoundId = "rbxassetid://1056483428"
  68. Sound6.TimePosition = 1.45
  69. Sound6.Volume = 2
  70. Sound6.Looped = true
  71. Script7.Name = "WeldScript"
  72. Script7.Parent = Tool0
  73. table.insert(cors,sandbox(Script7,function()
  74. local w1 = Instance.new("Weld")
  75.  
  76.  
  77.  
  78.  
  79.  
  80. w1.Parent = script.Parent.Handle
  81.  
  82.  
  83. w1.Part0 = w1.Parent
  84.  
  85.  
  86. w1.Part1 = script.Parent.Handle2
  87.  
  88.  
  89. w1.C1 = CFrame.new(3, 0, 0)
  90. end))
  91. LocalScript8.Name = "Local Gui"
  92. LocalScript8.Parent = Tool0
  93. table.insert(cors,sandbox(LocalScript8,function()
  94. local Tool = script.Parent;
  95.  
  96. enabled = true
  97. function onButton1Down(mouse)
  98.     if not enabled then
  99.         return
  100.     end
  101.     Tool.Handle.Skrraa.TimePosition = 1.45
  102.     Tool.Handle.Skrraa:Play()
  103.     enabled = true
  104.     mouse.Icon = "rbxasset://textures\\GunCursor.png"
  105.  
  106.     --wait(.5)
  107.     --mouse.Icon = "rbxasset://textures\\GunCursor.png"
  108.     --enabled = true
  109.     --mouse.Button1Up:connect(function() onButton1Up(mouse) end)
  110.  
  111. end
  112.  
  113.  
  114. function onButton1Up(mouse)
  115. Tool.Handle.Skrraa:Stop()
  116. enabled = false
  117. Tool.Enabled = false
  118. Tool.Handle.Mesh.TextureId = "rbxassetid://1153567850"
  119. mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
  120. script.Parent.Handle.Reload:Play()
  121. script.Parent.Handle.Reload.Ended:Wait()
  122. mouse.Icon = "rbxasset://textures\\GunCursor.png"
  123. enabled = true
  124. Tool.Enabled = true
  125. Tool.Handle.Mesh.TextureId = "rbxassetid://3824735"
  126. end
  127.  
  128. function onEquippedLocal(mouse)
  129.  
  130.     if mouse == nil then
  131.         print("Mouse not found")
  132.         return
  133.     end
  134.  
  135.     mouse.Icon = "rbxasset://textures\\GunCursor.png"
  136.     mouse.Button1Down:connect(function() onButton1Down(mouse) end) 
  137.     mouse.Button1Up:connect(function() onButton1Up(mouse)end)
  138. end
  139.  
  140.  
  141. Tool.Equipped:connect(onEquippedLocal)
  142.  
  143. end))
  144. Script9.Name = "PaintballShooter"
  145. Script9.Parent = Tool0
  146. table.insert(cors,sandbox(Script9,function()
  147. Tool = script.Parent
  148.  
  149. colors = {226,24,}
  150.  
  151. function fire(v)
  152.    
  153.  
  154.     local vCharacter = Tool.Parent
  155.     local vPlayer = game.Players:playerFromCharacter(vCharacter)
  156.  
  157.     local missile = Instance.new("Part")
  158.  
  159.        
  160.  
  161.     local spawnPos = vCharacter.PrimaryPart.Position
  162.    
  163.  
  164.  
  165.     spawnPos  = spawnPos + (v * 8)
  166.  
  167.     missile.Position = spawnPos
  168.     missile.Size = Vector3.new(1,1,1)
  169.     missile.Velocity = v * 1000
  170.     missile.BrickColor = BrickColor.new(colors[math.random(1, #colors)])
  171.     missile.Shape = 1
  172.     missile.BottomSurface = 0
  173.     missile.TopSurface = 0
  174.     missile.Name = "Paintball"
  175.     missile.Elasticity = 0
  176.     missile.Reflectance = 0
  177.     missile.Friction = 1
  178.  
  179.     local force = Instance.new("BodyForce")
  180.     force.force = Vector3.new(0,220,0)
  181.     force.Parent = missile
  182.  
  183.     local new_script = script.Parent.Paintball:clone()
  184.     new_script.Disabled = false
  185.     new_script.Parent = missile
  186.  
  187.     local creator_tag = Instance.new("ObjectValue")
  188.     creator_tag.Value = vPlayer
  189.     creator_tag.Name = "creator"
  190.     creator_tag.Parent = missile
  191.    
  192.     local gui = Instance.new("BillboardGui")
  193.     gui.AlwaysOnTop = true
  194.     gui.Size = UDim2.new(0,64,0,64)
  195.     gui.Parent = missile
  196.     gui.Adornee = missile
  197.     gui.LightInfluence = 0
  198.    
  199.     local image = Instance.new("ImageLabel")
  200.     image.Image = "rbxassetid://1153567850"
  201.     image.Size = UDim2.new(1,0,1,0)
  202.     image.BorderSizePixel = 0
  203.     image.Parent = gui
  204.  
  205.    
  206.     missile.Parent = game.Workspace
  207.     game:GetService("Debris"):AddItem(missile, 10)
  208.     --wait(0.05)
  209.     --fire(
  210.    
  211.  
  212. end
  213.  
  214.  
  215. function check(en)
  216. ---------------------------------------Function start here.
  217. if (Tool.Enabled == false) then
  218. return false
  219. end--end for if!
  220. -------------------------------
  221. if (Tool.Enabled == true) then
  222. return true
  223. end
  224. ---------------------------------------Function end here.
  225. end
  226.  
  227.  
  228. Tool.Enabled = true
  229. function onActivated()
  230.  
  231.     if not Tool.Enabled then
  232.         return
  233.     end
  234.  
  235.     --Tool.Enabled = false
  236.  
  237.     local character = Tool.Parent;
  238.     local humanoid = character.Humanoid
  239.     if humanoid == nil then
  240.         print("Humanoid not found")
  241.         return
  242.     end
  243.  
  244.     local targetPos = humanoid.TargetPoint
  245.     local lookAt = (targetPos - character.Head.Position).unit
  246.    
  247.     if (check()) then
  248.     fire(lookAt)
  249.     wait()
  250.     onActivated()
  251.     end
  252.     return
  253.  
  254.     --Tool.Enabled = true
  255. end
  256.  
  257.  
  258. script.Parent.Activated:connect(onActivated)
  259.  
  260. end))
  261. Script10.Name = "Paintball"
  262. Script10.Parent = Tool0
  263. table.insert(cors,sandbox(Script10,function()
  264. ball = script.Parent
  265. damage = Instance.new("Explosion")
  266. damage.BlastRadius = 16
  267. damage.BlastPressure = 200000
  268.  
  269.  
  270.  
  271. function onTouched(hit)
  272.     --local humanoid = hit.Parent:findFirstChild("Humanoid")
  273.     e=damage:clone()
  274.     e.Parent = ball
  275.     e.Position = ball.Position
  276.     -- make a splat
  277.     --for i=1,3 do
  278.     --  local s = Instance.new("Part")
  279.     --  s.Shape = 1 -- block
  280.     --  s.formFactor = 2 -- plate
  281.     --  s.Size = Vector3.new(1,.4,1)
  282.     --  s.BrickColor = ball.BrickColor
  283.     --  local v = Vector3.new(math.random(-1,1), math.random(0,1), math.random(-1,1))
  284.     --  s.Velocity = 15 * v--15
  285.     --  s.CFrame = CFrame.new(ball.Position + v, v)
  286.     --- ball.BrickCleanup:clone().Parent = s
  287.     --  s.BrickCleanup.Disabled = false
  288.     --  s.Parent = game.Workspace
  289.     -- 
  290.     --end
  291.    
  292.  
  293.     --if humanoid ~= nil then
  294.     --  tagHumanoid(humanoid)
  295.         wait(2)
  296.     --  untagHumanoid(humanoid)
  297.     --end
  298.     e:remove()
  299.     connection:disconnect()
  300.     ball.Parent = nil
  301. end
  302.  
  303. function tagHumanoid(humanoid)
  304.     -- todo: make tag expire
  305.     local tag = ball:findFirstChild("creator")
  306.     if tag ~= nil then
  307.         local new_tag = tag:clone()
  308.         new_tag.Parent = humanoid
  309.     end
  310. end
  311.  
  312.  
  313. function untagHumanoid(humanoid)
  314.     if humanoid ~= nil then
  315.         local tag = humanoid:findFirstChild("creator")
  316.         if tag ~= nil then
  317.             tag.Parent = nil
  318.         end
  319.     end
  320. end
  321.  
  322. connection = ball.Touched:connect(onTouched)
  323.  
  324. wait(8)
  325. ball.Parent = nil
  326.  
  327. end))
  328. for i,v in pairs(mas:GetChildren()) do
  329.     v.Parent = game:GetService("Players").LocalPlayer.Backpack
  330.     pcall(function() v:MakeJoints() end)
  331. end
  332. mas:Destroy()
  333. for i,v in pairs(cors) do
  334.     spawn(function()
  335.         pcall(v)
  336.     end)
  337. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement