Advertisement
Guest User

Sdsa

a guest
Apr 21st, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.07 KB | None | 0 0
  1.  
  2.  
  3. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  4. local Player,game,owner = owner,game
  5. local RealPlayer = Player
  6. do
  7. warn("thanks mokiros to fe thing")
  8. local rp = RealPlayer
  9. script.Parent = rp.Character
  10.  
  11. --RemoteEvent for communicating
  12. local Event = Instance.new("RemoteEvent")
  13. Event.Name = "UserInput_Event"
  14.  
  15. --Fake event to make stuff like Mouse.KeyDown work
  16. local function fakeEvent()
  17. local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
  18. t.connect = t.Connect
  19. return t
  20. end
  21.  
  22. --Creating fake input objects with fake variables
  23. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  24. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  25. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  26. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  27. end}
  28. --Merged 2 functions into one by checking amount of arguments
  29. CAS.UnbindAction = CAS.BindAction
  30.  
  31. --This function will trigger the events that have been :Connect()'ed
  32. local function te(self,ev,...)
  33. local t = m[ev]
  34. if t and t._fakeEvent then
  35. for _,f in pairs(t.Functions) do
  36. f(...)
  37. end
  38. end
  39. end
  40. m.TrigEvent = te
  41. UIS.TrigEvent = te
  42.  
  43. Event.OnServerEvent:Connect(function(plr,io)
  44. if plr~=rp then return end
  45. m.Target = io.Target
  46. m.Hit = io.Hit
  47. if not io.isMouse then
  48. local b = io.UserInputState == Enum.UserInputState.Begin
  49. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  50. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  51. end
  52. for _,t in pairs(CAS.Actions) do
  53. for _,k in pairs(t.Keys) do
  54. if k==io.KeyCode then
  55. t.Function(t.Name,io.UserInputState,io)
  56. end
  57. end
  58. end
  59. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  60. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  61. end
  62. end)
  63. Event.Parent = NLS([==[
  64. local Player = game:GetService("Players").LocalPlayer
  65. local Event = script:WaitForChild("UserInput_Event")
  66.  
  67. local Mouse = Player:GetMouse()
  68. local UIS = game:GetService("UserInputService")
  69. local input = function(io,a)
  70. if a then return end
  71. --Since InputObject is a client-side instance, we create and pass table instead
  72. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  73. end
  74. UIS.InputBegan:Connect(input)
  75. UIS.InputEnded:Connect(input)
  76.  
  77. local h,t
  78. --Give the server mouse data 30 times every second, but only if the values changed
  79. --If player is not moving their mouse, client won't fire events
  80. while wait(1/30) do
  81. if h~=Mouse.Hit or t~=Mouse.Target then
  82. h,t=Mouse.Hit,Mouse.Target
  83. Event:FireServer({isMouse=true,Target=t,Hit=h})
  84. end
  85. end]==],Player.Character)
  86.  
  87. ----Sandboxed game object that allows the usage of client-side methods and services
  88. --Real game object
  89. local _rg = game
  90.  
  91. --Metatable for fake service
  92. local fsmt = {
  93. __index = function(self,k)
  94. local s = rawget(self,"_RealService")
  95. if s then return s[k] end
  96. end,
  97. __newindex = function(self,k,v)
  98. local s = rawget(self,"_RealService")
  99. if s then s[k]=v end
  100. end,
  101. __call = function(self,...)
  102. local s = rawget(self,"_RealService")
  103. if s then return s(...) end
  104. end
  105. }
  106. local function FakeService(t,RealService)
  107. t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
  108. return setmetatable(t,fsmt)
  109. end
  110.  
  111. --Fake game object
  112. local g = {
  113. GetService = function(self,s)
  114. return self[s]
  115. end,
  116. Players = FakeService({
  117. LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
  118. },"Players"),
  119. UserInputService = FakeService(UIS,"UserInputService"),
  120. ContextActionService = FakeService(CAS,"ContextActionService"),
  121. }
  122. rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
  123. g.service = g.GetService
  124.  
  125. g.RunService = FakeService({
  126. RenderStepped = _rg:GetService("RunService").Heartbeat,
  127. BindToRenderStep = function(self,name,_,fun)
  128.  
  129. end,
  130. UnbindFromRenderStep = function(self,name)
  131. self._btrs[name]:Disconnect()
  132. end,
  133. },"RunService")
  134.  
  135. setmetatable(g,{
  136. __index=function(self,s)
  137. return _rg:GetService(s) or typeof(_rg[s])=="function"
  138. and function(_,...)return _rg[s](_rg,...)end or _rg[s]
  139. end,
  140. __newindex = fsmt.__newindex,
  141. __call = fsmt.__call
  142. })
  143. --Changing owner to fake player object to support owner:GetMouse()
  144. game,owner = g,g.Players.LocalPlayer
  145. end
  146.  
  147. local p = owner
  148. local char = p.Character
  149. local size = 8
  150. part = function()
  151.  
  152. local a = Instance.new("Part", script)
  153. a.Anchored = true
  154. a.CanCollide = true
  155. a.CFrame = char.Torso.CFrame
  156. a.Size = Vector3.new(size, 0.2, 0.2)
  157. a.Transparency = 1
  158. return a
  159. end
  160.  
  161. part2 = function()
  162.  
  163. local a = Instance.new("Part", script)
  164. a.Anchored = true
  165. a.CanCollide = true
  166. a.CFrame = char.Torso.CFrame
  167. a.Size = Vector3.new(0.2, size, 0.2)
  168. a.Transparency = 1
  169. return a
  170. end
  171.  
  172. part3 = function()
  173.  
  174. local a = Instance.new("Part", script)
  175. a.Anchored = true
  176. a.CanCollide = false
  177. a.Size = Vector3.new(size, size, 1)
  178. a.Transparency = 0.7
  179. a.Material = "Neon"
  180. a.BrickColor = BrickColor.new("Really red")
  181. local b = Instance.new("BlockMesh", a)
  182. b.Scale = Vector3.new(1, 1, 0)
  183. return a
  184. end
  185.  
  186. local replicating = false
  187. local root, a, b, c, d, a2, b2, c2, d2, aa, bb, cc, dd, z, x, c, v, b, n = nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil
  188. replicate = function()
  189.  
  190. replicating = true
  191. script:ClearAllChildren()
  192. root = part()
  193. root.Transparency = 1
  194. root.Size = Vector3.new(0.2, 0.2, 0.2)
  195. root.CanCollide = false
  196. a = part()
  197. b = part()
  198. c = part()
  199. d = part()
  200. a2 = part()
  201. b2 = part()
  202. c2 = part()
  203. d2 = part()
  204. aa = part2()
  205. bb = part2()
  206. cc = part2()
  207. dd = part2()
  208. z = part3()
  209. x = part3()
  210. c = part3()
  211. v = part3()
  212. b = part3()
  213. n = part3()
  214. replicating = false
  215. end
  216.  
  217. script.ChildRemoved:connect(function(a)
  218.  
  219. if a.ClassName == "Part" and replicating == false then
  220. replicate()
  221. end
  222. end
  223. )
  224. replicate()
  225. local tick = 0
  226. CreateRegion3FromLocAndSize = function(Position, Size)
  227.  
  228. local SizeOffset = Size / 2
  229. local Point1 = Position - SizeOffset
  230. local Point2 = Position + SizeOffset
  231. return Region3.new(Point1, Point2)
  232. end
  233.  
  234. local set = false
  235. local whitelist = {"Hieroku", "PPATTA", "DevGamerzz", "I kill U", "kash5", "ZeroCrimson", "Zaidia", "tsup2", "PointCoded", "CLarramore", "Suzuuki", "", "", ""}
  236. p.Chatted:connect(function(ms)
  237.  
  238. if ms:sub(1, 5) == "size-" then
  239. size = tonumber(ms:sub(6))
  240. replicate()
  241. else
  242. if ms:sub(1, 4) == "set-" then
  243. set = true
  244. z.CanCollide = false
  245. x.CanCollide = false
  246. c.CanCollide = false
  247. v.CanCollide = false
  248. b.CanCollide = false
  249. n.CanCollide = false
  250. else
  251. if ms:sub(1, 6) == "unset-" then
  252. set = false
  253. z.CanCollide = false
  254. x.CanCollide = false
  255. c.CanCollide = false
  256. v.CanCollide = false
  257. b.CanCollide = false
  258. n.CanCollide = false
  259. else
  260. if ms:sub(1, 10) == "whitelist-" then
  261. table.insert(whitelist, ms:sub(11))
  262. else
  263. if ms:sub(1, 12) == "unwhitelist-" then
  264. for i,v in pairs(whitelist) do
  265. if ms:sub(13) == v then
  266. table.remove(whitelist, i)
  267. break
  268. end
  269. end
  270. end
  271. end
  272. end
  273. end
  274. end
  275. end
  276. )
  277. local magicpos = nil
  278. game:GetService("RunService").Heartbeat:connect(function()
  279.  
  280. pcall(function()
  281.  
  282. local void = char:GetChildren()
  283. for _,pl in pairs(whitelist) do
  284. if game.Players:FindFirstChild(pl) ~= nil and game.Players:FindFirstChild(pl).Character ~= nil then
  285. for i,v in pairs(game.Players[pl].Character:GetChildren()) do
  286. table.insert(void, v)
  287. end
  288. end
  289. end
  290. for i,v in pairs(game.Players:GetPlayers()) do
  291. if v.Character:isDescendantOf(char) and not v.Name == "FangxWulf" then
  292. v:LoadCharacter()
  293. end
  294. end
  295. char.Humanoid.Health = math.huge
  296. tick = tick + 0.01
  297. if not set then
  298. root.CFrame = root.CFrame:lerp(CFrame.new(char.Torso.CFrame.p) * CFrame.Angles(math.sin(tick) * 100 / 30 / (size / 2), math.cos(tick) * 100 / 30 / (size / 2), math.cos(tick) * 100 / 30 / (size / 2)), 0.1)
  299. magicpos = char.Torso.CFrame
  300. else
  301. root.CFrame = root.CFrame:lerp(CFrame.new(magicpos.p) * CFrame.Angles(0, 0, 0), 0.05)
  302. end
  303. local reg = CreateRegion3FromLocAndSize(root.CFrame.p, Vector3.new(size, size, size))
  304. for i,v in pairs(game.Workspace:FindPartsInRegion3WithIgnoreList(reg, void, 100)) do
  305. if v.Name ~= "Base" then
  306. v:Destroy()
  307. end
  308. end
  309. a.CFrame = root.CFrame * CFrame.new(size / 2, size / 2, 0) * CFrame.Angles(0, math.rad(90), 0)
  310. b.CFrame = root.CFrame * CFrame.new(-size / 2, size / 2, 0) * CFrame.Angles(0, math.rad(90), 0)
  311. c.CFrame = root.CFrame * CFrame.new(0, size / 2, size / 2)
  312. d.CFrame = root.CFrame * CFrame.new(0, size / 2, -size / 2)
  313. a2.CFrame = root.CFrame * CFrame.new(size / 2, -size / 2, 0) * CFrame.Angles(0, math.rad(90), 0)
  314. b2.CFrame = root.CFrame * CFrame.new(-size / 2, -size / 2, 0) * CFrame.Angles(0, math.rad(90), 0)
  315. c2.CFrame = root.CFrame * CFrame.new(0, -size / 2, size / 2)
  316. d2.CFrame = root.CFrame * CFrame.new(0, -size / 2, -size / 2)
  317. aa.CFrame = root.CFrame * CFrame.new(size / 2, 0, size / 2)
  318. bb.CFrame = root.CFrame * CFrame.new(-size / 2, 0, size / 2)
  319. cc.CFrame = root.CFrame * CFrame.new(-size / 2, 0, -size / 2)
  320. dd.CFrame = root.CFrame * CFrame.new(size / 2, 0, -size / 2)
  321. z.CFrame = root.CFrame * CFrame.new(size / 2, 0, 0) * CFrame.Angles(0, math.rad(90), 0)
  322. x.CFrame = root.CFrame * CFrame.new(-size / 2, 0, 0) * CFrame.Angles(0, math.rad(90), 0)
  323. c.CFrame = root.CFrame * CFrame.new(0, 0, size / 2) * CFrame.Angles(0, 0, math.rad(90))
  324. v.CFrame = root.CFrame * CFrame.new(0, 0, -size / 2) * CFrame.Angles(0, 0, math.rad(90))
  325. b.CFrame = root.CFrame * CFrame.new(0, size / 2, 0) * CFrame.Angles(math.rad(90), 0, 0)
  326. n.CFrame = root.CFrame * CFrame.new(0, -size / 2, 0) * CFrame.Angles(math.rad(90), 0, 0)
  327. end
  328. )
  329. end
  330. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement