lotushomerun

Phone Bomb Script(Roblox)

May 26th, 2017
6,571
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.86 KB | None | 0 0
  1. -- A Samsung Galaxy Note 7 Rigged With Explodsives!
  2. local runDummyScript = function(f,scri)
  3. local oldenv = getfenv(f)
  4. local newenv = setmetatable({}, {
  5. __index = function(_, k)
  6. if k:lower() == 'script' then
  7. return scri
  8. else
  9. return oldenv[k]
  10. end
  11. end
  12. })
  13. setfenv(f, newenv)
  14. ypcall(function() f() end)
  15. end
  16. cors = {}
  17. mas = Instance.new("Model",game:GetService("Lighting"))
  18. mas.Name = "CompiledModel"
  19. o1 = Instance.new("Tool")
  20. o2 = Instance.new("Part")
  21. o3 = Instance.new("SpecialMesh")
  22. o4 = Instance.new("Sound")
  23. o5 = Instance.new("LocalScript")
  24. o1.Name = "Phone Bomb"
  25. o1.Parent = game.Players.LocalPlayer.Backpack
  26. o1.TextureId = "rbxassetid://16370867"
  27. o1.GripForward = Vector3.new(0.536952674, -0, -0.843612373)
  28. o1.GripPos = Vector3.new(0, -0.375, 0.25)
  29. o1.GripRight = Vector3.new(0.843612373, 0, 0.536952674)
  30. o1.ToolTip = "A Samsung Galaxy Note 7 Rigged With Explodsives!"
  31. o2.Name = "Handle"
  32. o2.Parent = o1
  33. o2.Position = Vector3.new(-4.320683, 0.855857015, -3.17578101)
  34. o2.FormFactor = Enum.FormFactor.Custom
  35. o2.Size = Vector3.new(0.75, 1.25, 0.200000003)
  36. o2.CFrame = CFrame.new(-4.320683, 0.855857015, -3.17578101, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  37. o2.BottomSurface = Enum.SurfaceType.Smooth
  38. o2.TopSurface = Enum.SurfaceType.Smooth
  39. o2.Position = Vector3.new(-4.320683, 0.855857015, -3.17578101)
  40. o3.Parent = o2
  41. o3.MeshId = "http://www.roblox.com/asset/?id=268471347"
  42. o3.Scale = Vector3.new(1.375, 1.375, 1.375)
  43. o3.TextureId = "rbxassetid://637111231"
  44. o3.MeshType = Enum.MeshType.FileMesh
  45. o4.Name = "Fire"
  46. o4.Parent = o2
  47. o4.SoundId = "rbxasset://sounds/swoosh.wav"
  48. o4.Volume = 0.69999998807907
  49. o5.Name = "MainScript"
  50. o5.Parent = o1
  51. table.insert(cors,coroutine.create(function()
  52. wait()
  53. runDummyScript(function()
  54. -- A Samsung Galaxy Note 7 Rigged With Explodsives!
  55.  
  56. --Varibles--
  57.  
  58. Uses = 1 --How many uses availible until its useless--
  59.  
  60. CanKill = true -- Can it kill people? --
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92. local tool = o1
  93.  
  94. ammountofuses = Uses
  95.  
  96. function swing(mouse)
  97.    
  98.         vCharacter = tool.Parent
  99.     vPlayer = game.Players:playerFromCharacter(vCharacter)
  100.    
  101.    
  102.     if ammountofuses > 0 then
  103.     ammountofuses = ammountofuses -1
  104.     print("Throwing a "..tool.Name.." from " ..vPlayer.Name.. "!")
  105.     tool.Handle.Fire:Play()
  106.     local explosive = tool.Handle:Clone()
  107.     --explosive.Position = tool.Handle.Position
  108.     explosive.CanCollide = true
  109.     explosive.Parent = workspace
  110.     explosive.RotVelocity=Vector3.new(0,0,0)
  111.     explosive.Velocity=(mouse.Hit.p-explosive.Position).unit*100+Vector3.new(0,10,0)
  112.     explosive.CFrame=CFrame.new(tool.Handle.Position,mouse.Hit.p)*CFrame.Angles(-math.pi/2,0,0)
  113.             if ammountofuses <= 0 then
  114.     script.Parent.Handle:Remove()
  115.     end
  116.     explode(explosive, tool)
  117.     end
  118. end
  119.  
  120. function explode(part, weapon)
  121.     local firesound = Instance.new("Sound", part)
  122.     firesound.SoundId = "rbxassetid://192104941"
  123.     local explodesound = Instance.new("Sound", part)
  124.     explodesound.SoundId = "rbxassetid://157878578"
  125.     wait(1)
  126.     local smoke = Instance.new("Smoke", part)
  127.     smoke.Color = Color3.new(0, 0, 0)
  128.     wait(2)
  129.     local fire = Instance.new("Fire", part)
  130.     firesound:Play()
  131.     wait(3)
  132.     local explosion = Instance.new("Explosion", part)
  133.     explodesound:Play()
  134.     explosion.Position = part.Position
  135.     if CanKill == true then
  136.     explosion.BlastPressure = 100000
  137.     else
  138.     explosion.BlastPressure = 0
  139.     end
  140.     explosion.Hit:connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") ~= nil then tagHumanoid(hit.Parent.Humanoid) delay(1, function() untagHumanoid(hit.Parent.Humanoid) end) end end)
  141.     wait(1)
  142.     part:Destroy()
  143.     if ammountofuses <= 0 then
  144.     weapon:Destroy()
  145.     end
  146. end
  147.  
  148. --script.Parent.Activated:connect(swing)
  149.  
  150. tool.Equipped:connect(function(mouse)
  151.     if mouse==nil then
  152.         print("Mouse not found")
  153.         return
  154.     end
  155.     equipped=true
  156.     mouse.Icon="rbxasset://textures\\GunCursor.png"
  157.     mouse.Button1Down:connect(function()
  158.         swing(mouse)
  159.     end)
  160. end)
  161.  
  162. function tagHumanoid(humanoid)
  163.     local tag = Instance.new("ObjectValue")
  164.     tag.Name = "creator"
  165.     tag.Value = vPlayer
  166.     tag.Parent = humanoid
  167.     local tag = Instance.new("StringValue")
  168.     tag.Name = "creatorType1"
  169.     tag.Value = tool.Name
  170.     tag.Parent = humanoid
  171.     local tag = Instance.new("StringValue")
  172.     tag.Name = "creatorType2"
  173.     tag.Value = "blown to pieces"
  174.     tag.Parent = humanoid
  175. end
  176.  
  177.  
  178. function untagHumanoid(humanoid)
  179.     if humanoid ~= nil then
  180.         local tag = humanoid:FindFirstChild("creator")
  181.         if tag ~= nil then
  182.             tag:Remove()
  183.         end
  184.         local tag = humanoid:FindFirstChild("creatorType1")
  185.         if tag ~= nil then
  186.             tag:Remove()
  187.         end
  188.         local tag = humanoid:FindFirstChild("creatorType2")
  189.         if tag ~= nil then
  190.             tag:Remove()
  191.         end
  192.     end
  193. end
  194.  
  195.  
  196. end,o5)
  197. end))
  198. mas.Parent = workspace
  199. mas:MakeJoints()
  200. local mas1 = mas:GetChildren()
  201. for i=1,#mas1 do
  202.     mas1[i].Parent = workspace
  203.     ypcall(function() mas1[i]:MakeJoints() end)
  204. end
  205. mas:Destroy()
  206. for i=1,#cors do
  207. coroutine.resume(cors[i])
  208. end
Add Comment
Please, Sign In to add comment