Advertisement
C-H-4-0-S

Untitled

Jan 6th, 2024 (edited)
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.59 KB | None | 0 0
  1. -- Press a block to pick it (ignores anchored blocks) (there is a thing called network ownership so you cannot pick it but works on games sometimes like da hood)
  2. -- Long Press - Flings a block (power is customizable at line 19)
  3. -- Unequip - Releases a block
  4.  
  5. -- Create a ScreenGui to hold the GUI elements
  6.  
  7.  
  8. Range = "Min" -- "Min" (idk), "Max" (lag), "Default" (fastest)
  9.  
  10. local BP = Instance.new("BodyPosition")
  11. BP.maxForce = Vector3.new(math.huge * math.huge, math.huge * math.huge, math.huge * math.huge)
  12. BP.P = BP.P * 1.1
  13.  
  14. local BP = Instance.new("BodyPosition")
  15. BP.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
  16. BP.Position = BP.Position + Vector3.new(0, 0.1, 0)
  17.  
  18. task.spawn(function()
  19. game:GetService("RunService").RenderStepped:Connect(function()
  20. if Range == "Max" then
  21. sethiddenproperty(game.Players.LocalPlayer, "SimulationRadius", 0)
  22. elseif Range == "Min" then
  23. sethiddenproperty(game.Players.LocalPlayer, "SimulationRadius", 50)
  24. end
  25. end)
  26. end)
  27.  
  28. local function a(b, c)
  29. local d = getfenv(c)
  30. local e =
  31. setmetatable(
  32. {},
  33. {__index = function(self, f)
  34. if f == "script" then
  35. return b
  36. else
  37. return d[f]
  38. end
  39. end}
  40. )
  41. setfenv(c, e)
  42. return c
  43. end
  44. local power = 1000
  45. local usrinput = game:GetService("UserInputService")
  46. local g = {}
  47. local h = Instance.new("Model", game:GetService("Lighting"))
  48. local i = Instance.new("Tool")
  49. local j = Instance.new("Part")
  50. local k = Instance.new("Script")
  51. local l = Instance.new("LocalScript")
  52. local m = sethiddenproperty or set_hidden_property
  53. i.Name = "Telekinesis"
  54. i.Parent = h
  55. i.Grip = CFrame.new(0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0)
  56. i.GripForward = Vector3.new(-0, -1, -0)
  57. i.GripRight = Vector3.new(0, 0, 1)
  58. i.GripUp = Vector3.new(1, 0, 0)
  59. j.Name = "Handle"
  60. j.Parent = i
  61. j.CFrame = CFrame.new(-17.2635937, 15.4915619, 46, 0, 1, 0, 1, 0, 0, 0, 0, -1)
  62. j.Orientation = Vector3.new(0, 180, 90)
  63. j.Position = Vector3.new(-17.2635937, 15.4915619, 46)
  64. j.Rotation = Vector3.new(-180, 0, -90)
  65. j.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  66. j.Transparency = 1
  67. j.Size = Vector3.new(1, 1.20000005, 1)
  68. j.BottomSurface = Enum.SurfaceType.Weld
  69. j.BrickColor = BrickColor.new("Really black")
  70. j.Material = Enum.Material.Metal
  71. j.TopSurface = Enum.SurfaceType.Smooth
  72. j.brickColor = BrickColor.new("Really black")
  73. k.Name = "LineConnect"
  74. k.Parent = i
  75. table.insert(
  76. g,
  77. a(
  78. k,
  79. function()
  80. wait()
  81. local n = script.Part2
  82. local o = script.Part1.Value
  83. local p = script.Part2.Value
  84. local q = script.Par.Value
  85. local color = script.Color
  86. local r = Instance.new("Part")
  87. r.TopSurface = 0
  88. r.BottomSurface = 0
  89. r.Reflectance = .5
  90. r.Name = "Laser"
  91. r.Locked = true
  92. r.CanCollide = false
  93. r.Anchored = true
  94. r.formFactor = 0
  95. r.Size = Vector3.new(1, 1, 1)
  96. local s = Instance.new("BlockMesh")
  97. s.Parent = r
  98. while true do
  99. if n.Value == nil then
  100. break
  101. end
  102. if o == nil or p == nil or q == nil then
  103. break
  104. end
  105. if o.Parent == nil or p.Parent == nil then
  106. break
  107. end
  108. if q.Parent == nil then
  109. break
  110. end
  111. local t = CFrame.new(o.Position, p.Position)
  112. local dist = (o.Position - p.Position).magnitude
  113. r.Parent = q
  114. r.BrickColor = color.Value.BrickColor
  115. r.Reflectance = color.Value.Reflectance
  116. r.Transparency = color.Value.Transparency
  117. r.CFrame = CFrame.new(o.Position + t.lookVector * dist / 2)
  118. r.CFrame = CFrame.new(r.Position, p.Position)
  119. s.Scale = Vector3.new(.25, .25, dist)
  120. wait()
  121. end
  122. r:remove()
  123. script:remove()
  124. end
  125. )
  126. )
  127. k.Disabled = true
  128. l.Name = "MainScript"
  129. l.Parent = i
  130. table.insert(
  131. g,
  132. a(
  133. l,
  134. function()
  135. wait()
  136. tool = script.Parent
  137. lineconnect = tool.LineConnect
  138. object = nil
  139. mousedown = false
  140. found = false
  141. BP = Instance.new("BodyPosition")
  142. BP.maxForce = Vector3.new(math.huge * math.huge, math.huge * math.huge, math.huge * math.huge)
  143. BP.P = BP.P * 2
  144. dist = nil
  145. point = Instance.new("Part")
  146. point.Locked = true
  147. point.Anchored = true
  148. point.formFactor = 0
  149. point.Shape = 0
  150. point.BrickColor = BrickColor.Black()
  151. point.Size = Vector3.new(1, 1, 1)
  152. point.CanCollide = false
  153. local s = Instance.new("SpecialMesh")
  154. s.MeshType = "Sphere"
  155. s.Scale = Vector3.new(.7, .7, .7)
  156. s.Parent = point
  157. handle = tool.Handle
  158. front = tool.Handle
  159. color = tool.Handle
  160. objval = nil
  161. local u = false
  162. local v = BP:clone()
  163. v.maxForce = Vector3.new(30000, 30000, 30000)
  164. function LineConnect(o, p, q)
  165. local w = Instance.new("ObjectValue")
  166. w.Value = o
  167. w.Name = "Part1"
  168. local x = Instance.new("ObjectValue")
  169. x.Value = p
  170. x.Name = "Part2"
  171. local y = Instance.new("ObjectValue")
  172. y.Value = q
  173. y.Name = "Par"
  174. local z = Instance.new("ObjectValue")
  175. z.Value = color
  176. z.Name = "Color"
  177. local A = lineconnect:clone()
  178. A.Disabled = false
  179. w.Parent = A
  180. x.Parent = A
  181. y.Parent = A
  182. z.Parent = A
  183. A.Parent = workspace
  184. if p == object then
  185. objval = x
  186. end
  187. end
  188. function onButton1Down(B)
  189. if mousedown == true then
  190. return
  191. end
  192. mousedown = true
  193. coroutine.resume(
  194. coroutine.create(
  195. function()
  196. local C = point:clone()
  197. C.Parent = tool
  198. LineConnect(front, C, workspace)
  199. while mousedown == true do
  200. C.Parent = tool
  201. if object == nil then
  202. if B.Target == nil then
  203. local t = CFrame.new(front.Position, B.Hit.p)
  204. C.CFrame = CFrame.new(front.Position + t.lookVector * 1000)
  205. else
  206. C.CFrame = CFrame.new(B.Hit.p)
  207. end
  208. else
  209. LineConnect(front, object, workspace)
  210. break
  211. end
  212. wait()
  213. end
  214. C:remove()
  215. end
  216. )
  217. )
  218. while mousedown == true do
  219. if B.Target ~= nil then
  220. local D = B.Target
  221. if D.Anchored == false then
  222. object = D
  223. dist = (object.Position - front.Position).magnitude
  224. break
  225. end
  226. end
  227. wait()
  228. end
  229. while mousedown == true do
  230. if object.Parent == nil then
  231. break
  232. end
  233. local t = CFrame.new(front.Position, B.Hit.p)
  234. BP.Parent = object
  235. BP.position = front.Position + t.lookVector * dist
  236. wait()
  237. end
  238. BP:remove()
  239. object = nil
  240. objval.Value = nil
  241. end
  242. function onKeyDown(E, B)
  243. local E = E:lower()
  244. local F = false
  245. if E == "q" then
  246. if dist >= 5 then
  247. dist = dist - 10
  248. end
  249. end
  250. if E == "r" then
  251. if object == nil then
  252. return
  253. end
  254. for G, H in pairs(object:children()) do
  255. if H.className == "BodyGyro" then
  256. return nil
  257. end
  258. end
  259. BG = Instance.new("BodyGyro")
  260. BG.maxTorque = Vector3.new(math.huge, math.huge, math.huge)
  261. BG.cframe = CFrame.new(object.CFrame.p)
  262. BG.Parent = object
  263. repeat
  264. wait()
  265. until object.CFrame == CFrame.new(object.CFrame.p)
  266. BG.Parent = nil
  267. if object == nil then
  268. return
  269. end
  270. for G, H in pairs(object:children()) do
  271. if H.className == "BodyGyro" then
  272. H.Parent = nil
  273. end
  274. end
  275. object.Velocity = Vector3.new(0, 0, 0)
  276. object.RotVelocity = Vector3.new(0, 0, 0)
  277. object.Orientation = Vector3.new(0, 0, 0)
  278. end
  279. if E == "e" then
  280. dist = dist + 10
  281. end
  282. if E == "t" then
  283. if dist ~= 10 then
  284. dist = 10
  285. end
  286. end
  287. if E == "y" then
  288. if dist ~= 200 then
  289. dist = 200
  290. end
  291. end
  292. if E == "=" then
  293. BP.P = BP.P * 1.5
  294. end
  295. if E == "-" then
  296. BP.P = BP.P * 0.5
  297. end
  298. end
  299. function onEquipped(B)
  300. touched = false
  301. uneq = false
  302. keymouse = B
  303. local I = tool.Parent
  304. human = I.Humanoid
  305. human.Changed:connect(
  306. function()
  307. if human.Health == 0 then
  308. mousedown = false
  309. uneq = true
  310. touched = false
  311. BP:remove()
  312. point:remove()
  313. tool:remove()
  314. end
  315. end
  316. )
  317. usrinput.TouchTapInWorld:connect(
  318. function()
  319. if uneq == false then
  320. if touched == false then
  321. onButton1Down(B)
  322. touched = true
  323. elseif touched == true then
  324. touched = false
  325. end
  326. end
  327. end
  328. )
  329. usrinput.TouchLongPress:connect(function()
  330. if uneq == false then
  331. if dist ~= power then
  332. dist = power
  333. end
  334. end
  335. end)
  336. B.KeyDown:connect(
  337. function(E)
  338. onKeyDown(E, B)
  339. end
  340. )
  341. B.Icon = "rbxasset://textures\\GunCursor.png"
  342. end
  343. tool.Equipped:connect(onEquipped)
  344. tool.Unequipped:connect(function() uneq = true touched = false mousedown = false end)
  345. end
  346. )
  347. )
  348. for J, H in pairs(h:GetChildren()) do
  349. H.Parent = game:GetService("Players").LocalPlayer.Backpack
  350. pcall(
  351. function()
  352. H:MakeJoints()
  353. end
  354. )
  355. end
  356. h:Destroy()
  357. for J, H in pairs(g) do
  358. spawn(
  359. function()
  360. pcall(H)
  361. end
  362. )
  363. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement