Advertisement
Hermaxs

RainbowWepThing

Mar 7th, 2019
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.10 KB | None | 0 0
  1. --https://github.com/Mokiros/roblox-FE-compatibility
  2. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  3. local Player,game,owner = owner,game
  4. local RealPlayer = Player
  5. do print("FE Compatibility code V2 by Mokiros")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
  6.  
  7.  
  8. local me = game.Players.LocalPlayer
  9. local character = me.Character
  10. local mouse = me:GetMouse()
  11.  
  12. local sqa = Instance.new("Part", character)
  13. sqa.Name = "SquareAura"
  14. sqa.Shape = "Ball"
  15. sqa.Size = Vector3.new(6, 6, 6)
  16. sqa.Transparency = 0.3
  17. sqa.TopSurface = "Smooth"
  18. sqa.BottomSurface = "Smooth"
  19. sqa.CanCollide = false
  20. sqa.Anchored = true
  21. local sqb = Instance.new("Part", character)
  22. sqb.Name = "SquareField"
  23. sqb.Size = Vector3.new(6, 6, 6)
  24. sqb.Transparency = 1
  25. sqb.TopSurface = "Smooth"
  26. sqb.BottomSurface = "Smooth"
  27. sqb.CanCollide = false
  28. sqb.Anchored = true
  29. sqb.Touched:connect(function(part)
  30. if part.Parent == character then
  31. return false
  32. elseif part.Name == "Handle" then
  33. return false
  34. else
  35. part:Destroy()
  36. end
  37. end)
  38.  
  39. coroutine.resume(coroutine.create(function()
  40. rot = 0
  41. size = 0
  42. while wait(0.01) do
  43. rot = rot + 1
  44. size = size + 0.1
  45. r = ((math.sin(rot/20))*100)+128
  46. g = ((math.sin(rot/20+40))*100)+128
  47. b = ((math.sin(rot/20+60))*100)+128
  48. sqa.Color = Color3.new(r/255,g/255,b/255)
  49. sqa.Size = sqa.Size + Vector3.new(math.sin(size)/5, math.sin(size)/5, math.sin(size)/5)
  50. sqa.CFrame = character.Torso.CFrame * CFrame.Angles(math.rad(rot), math.rad(rot), math.rad(rot))
  51. sqb.CFrame = character.Torso.CFrame
  52. end
  53. end))
  54.  
  55. function fP(Player)
  56. for i,v in pairs(game:GetService("Players"):GetPlayers()) do
  57. if v.Name:lower():match(Player:lower()) then
  58. return v
  59. else
  60. return false
  61. end
  62. end
  63. end
  64.  
  65. function CreateCircle(offset,angle)
  66. if not offset then
  67. offset = Vector3.new(0, 0, 0)
  68. end
  69. if not angle then
  70. angle = CFrame.Angles(0, 0, 0)
  71. end
  72. local m = Instance.new("Model", character)
  73. m.Name = "Circle"
  74. for i = 1, 20 do
  75. local p = Instance.new("Part")
  76. p.Anchored = true
  77. p.Size = Vector3.new(2, 2, 2)
  78. p.TopSurface,p.BottomSurface = "Smooth","Smooth"
  79. p.CanCollide = false
  80. p.CFrame = character.Torso.CFrame * CFrame.Angles(0, math.pi*20, 0)
  81. p.CFrame = p.CFrame * angle * CFrame.Angles(0, math.rad(i*18), 0) * CFrame.new(0, 0, 5) + offset
  82. p.BrickColor = BrickColor.Black()
  83. p.Transparency = 0.3
  84. local bf = Instance.new("BodyVelocity", p)
  85. bf.Velocity = -(p.CFrame.lookVector) * 200
  86. wait(1/90)
  87. p.Parent = m
  88. p.Touched:connect(function(part)
  89. if part.Parent then
  90. if part.Parent.ClassName == "Model" then
  91. plyr = fP(part.Parent.Name)
  92. if plyr then
  93. if plyr.Name ~= me.Name then
  94. plyr.Character.Humanoid.Health = plyr.Character.Humanoid.Health - 40
  95. else
  96. return false
  97. end
  98. else
  99. local hum = part.Parent:findFirstChild("Humanoid")
  100. if hum then
  101. hum.Health = hum.Health - 40
  102. else
  103. return false
  104. end
  105. end
  106. end
  107. else
  108. return false
  109. end
  110. end)
  111. end
  112. wait(.25)
  113. for i,v in pairs(m:GetChildren()) do
  114. v.Anchored = false
  115. wait(1/60)
  116. end
  117. wait(.5)
  118. m:Destroy()
  119. end
  120.  
  121. function InflateLaser(part)
  122. for i = 1, 10 do
  123. if part.Name:match("Laser") then
  124. part.Size = part.Size + Vector3.new(0.2, 0.5, 0)
  125. wait(1/60)
  126. end
  127. end
  128. end
  129.  
  130. function iSL(part)
  131. for i = 1, 10 do
  132. if part.Name:match("Laser") then
  133. part.Size = part.Size + Vector3.new(1, 0, 1)
  134. wait(1/60)
  135. end
  136. end
  137. end
  138.  
  139. function dSL(part)
  140. for i = 1, 10 do
  141. if part.Name:match("Laser") then
  142. part.Size = part.Size - Vector3.new(1, 0, 1)
  143. wait(1/60)
  144. end
  145. end
  146. part:Destroy()
  147. end
  148.  
  149. function DeflateLaser(part)
  150. for i = 1, 10 do
  151. if part.Name:match("Laser") then
  152. part.Size = part.Size - Vector3.new(0.2, 0.5, 0)
  153. wait(1/60)
  154. end
  155. end
  156. part:Destroy()
  157. end
  158.  
  159. function CreateLaser()
  160. local m = Instance.new("Model", character)
  161. m.Name = "Lasers"
  162. for i = 1, 8 do
  163. local p = Instance.new("Part", m)
  164. p.Size = Vector3.new(3, 6, 1)
  165. p.Anchored = true
  166. p.CanCollide = false
  167. p.TopSurface,p.BottomSurface = "Smooth","Smooth"
  168. p.Name = "Block"..i
  169. p.BrickColor = BrickColor.new("Really black")
  170. p.CFrame = character.Torso.CFrame * CFrame.Angles(0, math.rad(i*45), 0) * CFrame.new(0, 0, 6)
  171. local p2 = Instance.new("Part", m)
  172. p2.Name = "Laser"..i
  173. p2.Size = Vector3.new(0.1, 0.1, 1000)
  174. p2.Anchored = true
  175. p2.CFrame = p.CFrame * CFrame.new(0, 0, 500)
  176. p2.Transparency = 0.3
  177. p2.TopSurface,p2.BottomSurface = "Smooth","Smooth"
  178. p2.BrickColor = BrickColor.new("New Yeller")
  179. p2.CanCollide = false
  180. local w1 = Instance.new("Weld", p)
  181. w1.Part0 = p2
  182. w1.Part1 = p
  183. p2.Touched:connect(function(part)
  184. if part.Parent.ClassName == "Model" then
  185. plyr = fP(part.Parent.Name)
  186. if plyr then
  187. if plyr.Name ~= me.Name then
  188. plyr.Character.Humanoid.Health = plyr.Character.Humanoid.Health - 40
  189. else
  190. return false
  191. end
  192. else
  193. local hum = part.Parent:findFirstChild("Humanoid")
  194. if hum then
  195. hum.Health = hum.Health - 40
  196. else
  197. return false
  198. end
  199. end
  200. end
  201. end)
  202. end
  203. wait(0.25)
  204. for i,v in pairs(m:GetChildren()) do
  205. InflateLaser(v)
  206. end
  207. wait(1)
  208. for i,v in pairs(m:GetChildren()) do
  209. DeflateLaser(v)
  210. end
  211. wait(2)
  212. m:Destroy()
  213. end
  214.  
  215. function CreatePlatform()
  216. local plat = Instance.new("Part", character)
  217. plat.Size = Vector3.new(8, 1, 8)
  218. plat.TopSurface,plat.BottomSurface = "Smooth","Smooth"
  219. plat.Anchored = true
  220. plat.Color = sqa.Color
  221. plat.CFrame = character.Torso.CFrame * CFrame.new(0, -3, 0)
  222. plat.Transparency = 0.4
  223. wait(2)
  224. plat:Destroy()
  225. end
  226.  
  227. function CreatePPlatform()
  228. local plat = Instance.new("Part", character)
  229. plat.Size = Vector3.new(12, 1, 12)
  230. plat.TopSurface,plat.BottomSurface = "Smooth","Smooth"
  231. plat.Anchored = true
  232. plat.Color = sqa.Color
  233. plat.CFrame = character.Torso.CFrame * CFrame.new(0, -3, 0)
  234. plat.Transparency = 0.4
  235. end
  236.  
  237. function SkyLasers()
  238. for i = 1, math.random(5, 8) do
  239. local p = Instance.new("Part", character)
  240. p.Size = Vector3.new(0.1, 1000, 0.1)
  241. p.Anchored = true
  242. p.Name = "Laser"..i
  243. p.TopSurface,p.BottomSurface = "Smooth","Smooth"
  244. p.BrickColor = BrickColor.new("New Yeller")
  245. p.Transparency = 0.5
  246. p.CanCollide = false
  247. p.CFrame = character.Torso.CFrame * CFrame.new(math.random(-20, 20), 500-character.Torso.CFrame.y, math.random(-20, 20))
  248. p.Touched:connect(function(part)
  249. if part.Parent.ClassName == "Model" then
  250. plyr = fP(part.Parent.Name)
  251. if plyr then
  252. if plyr.Name ~= me.Name then
  253. plyr.Character.Humanoid.Health = plyr.Character.Humanoid.Health - 40
  254. else
  255. return false
  256. end
  257. else
  258. local hum = part.Parent:findFirstChild("Humanoid")
  259. if hum then
  260. hum.Health = hum.Health - 40
  261. else
  262. return false
  263. end
  264. end
  265. end
  266. end)
  267. iSL(p)
  268. wait(1)
  269. dSL(p)
  270. end
  271. end
  272.  
  273. mouse.KeyDown:connect(function(key)
  274. if key == "r" then
  275. CreateCircle()
  276. elseif key == "l" then
  277. CreateLaser()
  278. elseif key == "p" then
  279. CreatePlatform()
  280. elseif key == "q" then
  281. for i = 1, 4 do
  282. local off = Vector3.new(math.random(-20, 20), 0, math.random(-20, 20))
  283. CreateCircle(off)
  284. end
  285. elseif key == "[" then
  286. CreatePPlatform()
  287. elseif key == "e" then
  288. SkyLasers()
  289. end
  290. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement