Advertisement
LoKBloxed

torch

Nov 30th, 2019
417
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.21 KB | None | 0 0
  1. --[torch by lookingbloxed]--
  2. if game:GetService("RunService"):IsClient() then error("This aint it chief") end
  3.  
  4. local Player,game,owner = owner,game
  5.  
  6. local RealPlayer = Player
  7.  
  8. do print("Made by lookingBloxed")local RealPlayer=RealPlayer;script.Parent=RealPlayer.Character;local a=function(b)b[1].f[b[2]]=nil end;local c={__index={disconnect=a,Disconnect=a}}local d={__index={Connect=function(b,e)local f=tostring(math.random(0,10000))while b.f[f]do f=tostring(math.random(0,10000))end;b.f[f]=e;return setmetatable({b,f},c)end}}d.__index.connect=d.__index.Connect;local function g()return setmetatable({f={}},d)end;local h={Hit=CFrame.new(),KeyUp=g(),KeyDown=g(),Button1Up=g(),Button1Down=g(),Button2Up=g(),Button2Down=g()}h.keyUp=h.KeyUp;h.keyDown=h.KeyDown;local i={InputBegan=g(),InputEnded=g()}local CAS={Actions={},BindAction=function(self,j,k,l,...)CAS.Actions[j]=k and{Name=j,Function=k,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function m(self,n,...)for o,e in pairs(self[n].f)do e(...)end end;h.T=m;i.T=m;local p=Instance.new("RemoteEvent")p.Name="UserInput_Event"p.OnServerEvent:Connect(function(q,r)if q~=RealPlayer then return end;h.Target=r.e;h.Hit=r.d;if not r.f then local s=r.c==Enum.UserInputState.Begin;if r.b==Enum.UserInputType.MouseButton1 then return h:T(s and"Button1Down"or"Button1Up")end;if r.b==Enum.UserInputType.MouseButton2 then return h:T(s and"Button2Down"or"Button2Up")end;for o,t in pairs(CAS.Actions)do for o,u in pairs(t.Keys)do if u==r.a then t.Function(t.Name,r.c,r)end end end;h:T(s and"KeyDown"or"KeyUp",r.a.Name:lower())i:T(s and"InputBegan"or"InputEnded",r,false)end end)p.Parent=NLS([==[local a=script:WaitForChild("UserInput_Event")local b=owner:GetMouse()local c=game:GetService("UserInputService")local d=function(e,f)if f then return end;a:FireServer({a=e.KeyCode,b=e.UserInputType,c=e.UserInputState,d=b.Hit,e=b.Target})end;c.InputBegan:Connect(d)c.InputEnded:Connect(d)local g,h;local i=game:GetService("RunService").Heartbeat;while true do if g~=b.Hit or h~=b.Target then g,h=b.Hit,b.Target;a:FireServer({f=1,Target=h,d=g})end;for j=1,2 do i:Wait()end end]==],script)local v=game;local w={__index=function(self,u)local x=rawget(self,"_RealService")if x then return typeof(x[u])=="function"and function(o,...)return x[u](x,...)end or x[u]end end,__newindex=function(self,u,y)local x=rawget(self,"_RealService")if x then x[u]=y end end}local function z(t,A)t._RealService=typeof(A)=="string"and v:GetService(A)or A;return setmetatable(t,w)end;local B={GetService=function(self,x)return rawget(self,x)or v:GetService(x)end,Players=z({LocalPlayer=z({GetMouse=function(self)return h end},Player)},"Players"),UserInputService=z(i,"UserInputService"),ContextActionService=z(CAS,"ContextActionService"),RunService=z({_btrs={},RenderStepped=v:GetService("RunService").Heartbeat,BindToRenderStep=function(self,j,o,k)self._btrs[j]=self.Heartbeat:Connect(k)end,UnbindFromRenderStep=function(self,j)self._btrs[j]:Disconnect()end},"RunService")}rawset(B.Players,"localPlayer",B.Players.LocalPlayer)B.service=B.GetService;z(B,game)game,owner=B,B.Players.LocalPlayer end
  9.  
  10. function sandbox(var,func)
  11. local env = getfenv(func)
  12. local newenv = setmetatable({},{
  13. __index = function(self,k)
  14. if k=="script" then
  15. return var
  16. else
  17. return env[k]
  18. end
  19. end,
  20. })
  21. setfenv(func,newenv)
  22. return func
  23. end
  24. cors = {}
  25. mas = Instance.new("Model",game:GetService("Lighting"))
  26. Tool0 = Instance.new("Tool")
  27. Script1 = Instance.new("Script")
  28. Part2 = Instance.new("Part")
  29. Texture3 = Instance.new("Texture")
  30. Decal4 = Instance.new("Decal")
  31. Decal5 = Instance.new("Decal")
  32. Decal6 = Instance.new("Decal")
  33. Decal7 = Instance.new("Decal")
  34. Decal8 = Instance.new("Decal")
  35. Weld9 = Instance.new("Weld")
  36. Part10 = Instance.new("Part")
  37. SpotLight11 = Instance.new("SpotLight")
  38. Part12 = Instance.new("Part")
  39. SpotLight13 = Instance.new("SpotLight")
  40. Part14 = Instance.new("Part")
  41. SpotLight15 = Instance.new("SpotLight")
  42. Part16 = Instance.new("Part")
  43. SpotLight17 = Instance.new("SpotLight")
  44. Part18 = Instance.new("Part")
  45. Tool0.Name = "torch (minecraft) tool"
  46. Tool0.Parent = mas
  47. Tool0.Grip = CFrame.new(0, -0.5, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  48. Tool0.GripPos = Vector3.new(0, -0.5, 0)
  49. Script1.Name = "Weld"
  50. Script1.Parent = Tool0
  51. table.insert(cors,sandbox(Script1,function()
  52. local tool = script.Parent
  53.  
  54. local MasterCFrameValues = {}
  55. local meta = {
  56. __call = function(tab,arg)
  57. for i = 1, #tab do
  58. if tab[i][1] == arg then
  59. return tab[i][2]
  60. end
  61. end
  62. return CFrame.new()
  63. end}
  64. setmetatable(MasterCFrameValues,meta)
  65.  
  66. local ch = tool:GetChildren()
  67. for i = 1, #ch do
  68. if ch[i]:IsA("BasePart") then
  69. table.insert(MasterCFrameValues,{ch[i],ch[i].CFrame:inverse()})
  70. ch[i].Anchored = false
  71. if ch[i].Name ~= "Handle" then
  72. ch[i].CanCollide = false
  73. else
  74. ch[i].CanCollide = true
  75. end
  76. end
  77. end
  78.  
  79. function weld()
  80. local han = tool:FindFirstChild("Handle")
  81. if not han then
  82. print("Handle went bye bye")
  83. return
  84. end
  85. local ch = han:GetChildren()
  86. for i = 1, #ch do
  87. if ch[i]:IsA("Weld") then
  88. ch[i]:remove()
  89. end
  90. end
  91. local ch = tool:GetChildren()
  92. for i = 1, #ch do
  93. if ch[i] ~= han and ch[i]:IsA("BasePart") then
  94. local w = Instance.new("Weld")
  95. w.Part0 = han
  96. w.Part1 = ch[i]
  97. w.C0 = MasterCFrameValues(han)
  98. w.C1 = MasterCFrameValues(ch[i])
  99. w.Parent = han
  100. end
  101. end
  102. end
  103.  
  104. weld()
  105.  
  106. tool.Equipped:connect(weld)
  107. end))
  108. Part2.Name = "Handle"
  109. Part2.Parent = Tool0
  110. Part2.CFrame = CFrame.new(5.49240112, 1.33501148, -70.6059875, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  111. Part2.Position = Vector3.new(5.49240112, 1.33501148, -70.6059875)
  112. Part2.Color = Color3.new(0.960784, 0.803922, 0.188235)
  113. Part2.Size = Vector3.new(0.600000024, 2.66999888, 0.600000024)
  114. Part2.BottomSurface = Enum.SurfaceType.Smooth
  115. Part2.BrickColor = BrickColor.new("Bright yellow")
  116. Part2.Material = Enum.Material.Foil
  117. Part2.TopSurface = Enum.SurfaceType.Weld
  118. Part2.brickColor = BrickColor.new("Bright yellow")
  119. Part2.FormFactor = Enum.FormFactor.Custom
  120. Part2.formFactor = Enum.FormFactor.Custom
  121. Texture3.Parent = Part2
  122. Texture3.Texture = "http://www.roblox.com/asset/?id=15845700"
  123. Texture3.Transparency = 0.30000001192093
  124. Texture3.Face = Enum.NormalId.Bottom
  125. Texture3.StudsPerTileU = 4
  126. Texture3.StudsPerTileV = 4
  127. Decal4.Parent = Part2
  128. Decal4.Texture = "http://www.roblox.com/asset/?id=61211135"
  129. Decal4.Face = Enum.NormalId.Back
  130. Decal5.Parent = Part2
  131. Decal5.Texture = "http://www.roblox.com/asset/?id=61211135"
  132. Decal5.Face = Enum.NormalId.Left
  133. Decal6.Parent = Part2
  134. Decal6.Texture = "http://www.roblox.com/asset/?id=61211135"
  135. Decal6.Face = Enum.NormalId.Right
  136. Decal7.Parent = Part2
  137. Decal7.Texture = "http://www.roblox.com/asset/?id=61211168"
  138. Decal7.Face = Enum.NormalId.Top
  139. Decal8.Parent = Part2
  140. Decal8.Texture = "http://www.roblox.com/asset/?id=61211135"
  141. Weld9.Parent = Part2
  142. Weld9.C0 = CFrame.new(-256, 10, 256, -1, 0, 0, 0, 0, 1, 0, 1, 0)
  143. Weld9.C1 = CFrame.new(-277.985168, -1.33501148, 326.605988, -1, 0, 0, 0, 0, 1, 0, 1, 0)
  144. Weld9.Part0 = nil
  145. Weld9.Part1 = Part2
  146. Weld9.part1 = Part2
  147. Part10.Name = "Light"
  148. Part10.Parent = Tool0
  149. Part10.CFrame = CFrame.new(5.69241285, 1.50001395, -70.6059875, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  150. Part10.Orientation = Vector3.new(0, -90, 0)
  151. Part10.Position = Vector3.new(5.69241285, 1.50001395, -70.6059875)
  152. Part10.Rotation = Vector3.new(0, -90, 0)
  153. Part10.Transparency = 1
  154. Part10.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
  155. Part10.BottomSurface = Enum.SurfaceType.Weld
  156. Part10.TopSurface = Enum.SurfaceType.Smooth
  157. Part10.FormFactor = Enum.FormFactor.Custom
  158. Part10.formFactor = Enum.FormFactor.Custom
  159. SpotLight11.Parent = Part10
  160. SpotLight11.Brightness = 0.5
  161. SpotLight11.Angle = 180
  162. Part12.Name = "Light"
  163. Part12.Parent = Tool0
  164. Part12.CFrame = CFrame.new(5.29241896, 1.49000394, -70.6059875, 0, 0, 0.999999702, 0, 1, 0, -0.999999702, 0, 0)
  165. Part12.Orientation = Vector3.new(0, 90, 0)
  166. Part12.Position = Vector3.new(5.29241896, 1.49000394, -70.6059875)
  167. Part12.Rotation = Vector3.new(0, 89.9599991, 0)
  168. Part12.Transparency = 1
  169. Part12.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
  170. Part12.BottomSurface = Enum.SurfaceType.Weld
  171. Part12.TopSurface = Enum.SurfaceType.Smooth
  172. Part12.FormFactor = Enum.FormFactor.Custom
  173. Part12.formFactor = Enum.FormFactor.Custom
  174. SpotLight13.Parent = Part12
  175. SpotLight13.Brightness = 0.5
  176. SpotLight13.Angle = 180
  177. Part14.Name = "Light"
  178. Part14.Parent = Tool0
  179. Part14.CFrame = CFrame.new(5.4924159, 1.49000394, -70.4059906, -0.999999404, 0, -1.1920929e-07, 1.4901155e-08, 0.999999762, 8.8817842e-16, 7.4505806e-08, 1.46936794e-39, -0.999999523)
  180. Part14.Orientation = Vector3.new(0, -180, 0)
  181. Part14.Position = Vector3.new(5.4924159, 1.49000394, -70.4059906)
  182. Part14.Rotation = Vector3.new(-180, 0, -180)
  183. Part14.Transparency = 1
  184. Part14.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
  185. Part14.BottomSurface = Enum.SurfaceType.Weld
  186. Part14.TopSurface = Enum.SurfaceType.Smooth
  187. Part14.FormFactor = Enum.FormFactor.Custom
  188. Part14.formFactor = Enum.FormFactor.Custom
  189. SpotLight15.Parent = Part14
  190. SpotLight15.Brightness = 0.5
  191. SpotLight15.Angle = 180
  192. Part16.Name = "Light"
  193. Part16.Parent = Tool0
  194. Part16.CFrame = CFrame.new(5.4924159, 1.49000394, -70.8059845, 1, 0, -1.22101008e-31, 0, 1, 0, -1.22101008e-31, 0, 1)
  195. Part16.Position = Vector3.new(5.4924159, 1.49000394, -70.8059845)
  196. Part16.Transparency = 1
  197. Part16.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
  198. Part16.BottomSurface = Enum.SurfaceType.Weld
  199. Part16.TopSurface = Enum.SurfaceType.Smooth
  200. Part16.FormFactor = Enum.FormFactor.Custom
  201. Part16.formFactor = Enum.FormFactor.Custom
  202. SpotLight17.Parent = Part16
  203. SpotLight17.Brightness = 0.5
  204. SpotLight17.Angle = 180
  205. Part18.Name = "Fire"
  206. Part18.Parent = Tool0
  207. Part18.CFrame = CFrame.new(5.4924159, 1.50001395, -70.6059875, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  208. Part18.Position = Vector3.new(5.4924159, 1.50001395, -70.6059875)
  209. Part18.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
  210. Part18.BottomSurface = Enum.SurfaceType.Weld
  211. Part18.TopSurface = Enum.SurfaceType.Smooth
  212. Part18.FormFactor = Enum.FormFactor.Custom
  213. Part18.formFactor = Enum.FormFactor.Custom
  214. for i,v in pairs(mas:GetChildren()) do
  215. v.Parent = game:GetService("Players").LocalPlayer.Backpack
  216. pcall(function() v:MakeJoints() end)
  217. end
  218. mas:Destroy()
  219. for i,v in pairs(cors) do
  220. spawn(function()
  221. pcall(v)
  222. end)
  223. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement