Advertisement
mr2meows

subspace tripmine

Jul 3rd, 2022
307
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.18 KB | None | 0 0
  1. -- Objects To Lua Make By HairBaconGamming --
  2. local Module_Scripts = {}
  3. local SubspaceTripmine = Instance.new("Tool")
  4. local Handle = Instance.new("Part")
  5. local Mesh = Instance.new("SpecialMesh")
  6. local Local_Gui = Instance.new("LocalScript")
  7. local PlantBomb = Instance.new("Script")
  8. local SubspaceMine = Instance.new("Script")
  9.  
  10. -- Properties --
  11.  
  12. SubspaceTripmine.Grip = CFrame.new(-0.5, 0, 0, 0, 0, -1, -0, 1, 0, 1, 0, 0)
  13. SubspaceTripmine.GripForward = Vector3.new(1, -0, -0)
  14. SubspaceTripmine.GripPos = Vector3.new(-0.5, 0, 0)
  15. SubspaceTripmine.GripRight = Vector3.new(0, -0, 1)
  16. SubspaceTripmine.Name = [[SubspaceTripmine]]
  17. SubspaceTripmine.Parent = owner.Backpack
  18. SubspaceTripmine.TextureId = [[http://www.roblox.com/asset/?id=11987521]]
  19.  
  20. Handle.BottomSurface = Enum.SurfaceType.Smooth
  21. Handle.BrickColor = BrickColor.new([[Hot pink]])
  22. Handle.CFrame = CFrame.new(-2, 3.4000001, 10, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  23. Handle.Color = Color3.new(1, 0, 0.74902)
  24. Handle.Name = [[Handle]]
  25. Handle.Parent = SubspaceTripmine
  26. Handle.Position = Vector3.new(-2, 3.4000000953674316, 10)
  27. Handle.Size = Vector3.new(2, 2, 2)
  28. Handle.TopSurface = Enum.SurfaceType.Smooth
  29.  
  30. Mesh.MeshId = [[http://www.roblox.com/asset/?id=11954776]]
  31. Mesh.MeshType = Enum.MeshType.FileMesh
  32. Mesh.Parent = Handle
  33. Mesh.Scale = Vector3.new(0.699999988079071, 0.699999988079071, 0.699999988079071)
  34. Mesh.TextureId = [[http://www.roblox.com/asset/?id=11954766]]
  35.  
  36. function Local_Gui_ScriptfakeXD()
  37.  
  38. local script = Instance.new("LocalScript",SubspaceTripmine)
  39. Local_Gui = script
  40. script.Name = [[Local Gui]]
  41. local require_fake = require
  42. local require = function(Object)
  43. local functiom = Module_Scripts[Object]
  44. if functiom then
  45. return functiom()
  46. end
  47. return require_fake(Object)
  48. end
  49.  
  50. local Tool = script.Parent;
  51.  
  52. enabled = true
  53. function onButton1Down(mouse)
  54. if not enabled then
  55. return
  56. end
  57.  
  58. enabled = false
  59. mouse.Icon = "rbxasset://textures\\ArrowFarCursor.png"
  60.  
  61. wait(3)
  62. mouse.Icon = "rbxasset://textures\\ArrowCursor.png"
  63. enabled = true
  64.  
  65. end
  66.  
  67. function onEquippedLocal(mouse)
  68.  
  69. if mouse == nil then
  70. print("Mouse not found")
  71. return
  72. end
  73.  
  74. mouse.Icon = "rbxasset://textures\\ArrowCursor.png"
  75. mouse.Button1Down:connect(function() onButton1Down(mouse) end)
  76. end
  77.  
  78. Tool.Equipped:connect(onEquippedLocal)
  79.  
  80.  
  81. end
  82. coroutine.wrap(Local_Gui_ScriptfakeXD)()
  83.  
  84.  
  85. function PlantBomb_ScriptfakeXD()
  86.  
  87. local script = Instance.new("Script",SubspaceTripmine)
  88. PlantBomb = script
  89. script.Name = [[PlantBomb]]
  90. local require_fake = require
  91. local require = function(Object)
  92. local functiom = Module_Scripts[Object]
  93. if functiom then
  94. return functiom()
  95. end
  96. return require_fake(Object)
  97. end
  98.  
  99. bombScript = script.Parent.SubspaceMine
  100. Tool = script.Parent
  101.  
  102. function plant(pos)
  103.  
  104.  
  105. local vCharacter = Tool.Parent
  106. local vPlayer = game.Players:playerFromCharacter(vCharacter)
  107.  
  108. local spawnPos = vCharacter.PrimaryPart.Position
  109.  
  110.  
  111. local bomb = Tool.Handle:Clone()
  112. bomb.CanCollide = true
  113. bomb.Transparency = 0
  114. bomb.Position = pos
  115. bomb.Size = Vector3.new(2,2,2)
  116. bomb.Name = "SubspaceTripmine"
  117. bomb.Locked = true
  118.  
  119.  
  120. local creator_tag = Instance.new("ObjectValue")
  121. creator_tag.Value = vPlayer
  122. creator_tag.Name = "creator"
  123. creator_tag.Parent = bomb
  124.  
  125. bomb.Parent = game.Workspace
  126. local new_script = bombScript:clone()
  127. new_script.Disabled = false
  128. new_script.Parent = bomb
  129.  
  130. end
  131.  
  132.  
  133. Tool.Enabled = true
  134. function onActivated()
  135.  
  136. if not Tool.Enabled then
  137. return
  138. end
  139.  
  140. Tool.Enabled = false
  141.  
  142. local character = Tool.Parent;
  143. local humanoid = character.Humanoid
  144. if humanoid == nil then
  145. print("Humanoid not found")
  146. return
  147. end
  148.  
  149. local targetPos = humanoid.TargetPoint
  150.  
  151. Tool.Handle.Transparency = 1
  152. plant(Tool.Handle.Position)
  153. wait(3)
  154. Tool.Handle.Transparency = 0
  155.  
  156. Tool.Enabled = true
  157. end
  158.  
  159.  
  160. script.Parent.Activated:connect(onActivated)
  161.  
  162. end
  163. coroutine.wrap(PlantBomb_ScriptfakeXD)()
  164.  
  165.  
  166. function SubspaceMine_ScriptfakeXD()
  167.  
  168. local script = Instance.new("Script",SubspaceTripmine)
  169. SubspaceMine = script
  170. script.Name = [[SubspaceMine]]
  171. local require_fake = require
  172. local require = function(Object)
  173. local functiom = Module_Scripts[Object]
  174. if functiom then
  175. return functiom()
  176. end
  177. return require_fake(Object)
  178. end
  179.  
  180. Mine = script.Parent
  181.  
  182. DunDun = Instance.new("Sound")
  183. DunDun.SoundId = "http://www.roblox.com/asset/?id=11984254"
  184. DunDun.Parent = Mine
  185.  
  186. SubspaceExplosion = Instance.new("Sound")
  187. SubspaceExplosion.SoundId = "http://www.roblox.com/asset/?id=11984351"
  188. SubspaceExplosion.Parent = Mine
  189.  
  190. Calibrate = Instance.new("Sound")
  191. Calibrate.SoundId = "http://www.roblox.com/asset/?id=11956590"
  192. Calibrate.Looped = true
  193. Calibrate.Parent = Mine
  194. Calibrate:Play()
  195.  
  196. local calibration_time = 2 -- needs to be still/untouched for this long before calibrating
  197. local cur_time = 0
  198. local max_life = 120 -- these things last for 2 minutes on their own, once activated
  199. local calibrated = false
  200.  
  201. local connection = nil
  202.  
  203. function activateMine()
  204. for i=0,1,.1 do
  205. Mine.Transparency = i
  206. wait(.05)
  207. end
  208. calibrated = true
  209. Calibrate:Stop()
  210. end
  211.  
  212. function pulse()
  213. DunDun:Play()
  214.  
  215. for i=.9,.5,-.1 do
  216. Mine.Transparency = i
  217. wait(.05)
  218. end
  219.  
  220. for i=.5,1,.1 do
  221. Mine.Transparency = i
  222. wait(.05)
  223. end
  224. end
  225.  
  226. function explode()
  227. connection:disconnect()
  228.  
  229. for i=1,0,-.2 do
  230. Mine.Transparency = i
  231. wait(.05)
  232. end
  233. SubspaceExplosion:Play()
  234.  
  235. local e = Instance.new("Explosion")
  236. e.BlastRadius = 16
  237. e.BlastPressure = 1000000
  238. e.Position = Mine.Position
  239. e.Parent = Mine
  240.  
  241. local creator = script.Parent:findFirstChild("creator")
  242.  
  243. e.Hit:connect(function(part, distance) onPlayerBlownUp(part, distance, creator) end)
  244.  
  245.  
  246. for i=0,1,.2 do
  247. Mine.Transparency = i
  248. wait(.05)
  249. end
  250. wait(4)
  251. Mine:Remove()
  252. end
  253.  
  254. function update()
  255. if (calibrated == false) then
  256. if (Mine.Velocity.magnitude > .05) then
  257. cur_time = 0
  258. end
  259.  
  260. if (cur_time > calibration_time) then
  261. activateMine()
  262. end
  263. else
  264. -- calibrated mine
  265. if (math.random(1,20) == 2) then
  266. pulse()
  267. end
  268.  
  269. if (cur_time > max_life) then pulse() Mine:Remove() end
  270. end
  271. end
  272.  
  273.  
  274. function OnTouch(part)
  275. if (calibrated == false) then
  276. cur_time = 0
  277. else
  278. explode()
  279. end
  280. end
  281.  
  282.  
  283. function onPlayerBlownUp(part, distance, creator)
  284.  
  285. if (part:getMass() < 300) then
  286. part.BrickColor = BrickColor.new(1032)
  287. local s = Instance.new("Sparkles")
  288. s.Parent = part
  289. game.Debris:AddItem(s, 5)
  290. end
  291.  
  292.  
  293. if creator ~= nil and part.Name == "Head" then
  294. local humanoid = part.Parent.Humanoid
  295. tagHumanoid(humanoid, creator)
  296. end
  297. end
  298.  
  299. function tagHumanoid(humanoid, creator)
  300. -- tag does not need to expire iff all explosions lethal
  301.  
  302. if creator ~= nil then
  303. local new_tag = creator:clone()
  304. new_tag.Parent = humanoid
  305. end
  306. end
  307.  
  308. function untagHumanoid(humanoid)
  309. if humanoid ~= nil then
  310. local tag = humanoid:findFirstChild("creator")
  311. if tag ~= nil then
  312. tag.Parent = nil
  313. end
  314. end
  315. end
  316.  
  317. connection = Mine.Touched:connect(OnTouch)
  318.  
  319.  
  320. while true do
  321. update()
  322. local e,g = wait(.5)
  323. cur_time = cur_time + e
  324. end
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332. end
  333. coroutine.wrap(SubspaceMine_ScriptfakeXD)()
  334.  
  335.  
  336. -- End --
  337. -- Thank for using --
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement