ChunkX

Telekinesis script FE

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