Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.51 KB | None | 0 0
  1. -- This script has been converted to FE by iPxter
  2.  
  3.  
  4. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  5. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  6. do
  7. print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
  8. script.Parent = Player.Character
  9.  
  10. --RemoteEvent for communicating
  11. local Event = Instance.new("RemoteEvent")
  12. Event.Name = "UserInput_Event"
  13.  
  14. --Fake event to make stuff like Mouse.KeyDown work
  15. local function fakeEvent()
  16. local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  17. t.connect = t.Connect
  18. return t
  19. end
  20.  
  21. --Creating fake input objects with fake variables
  22. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  23. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  24. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  25. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  26. end}
  27. --Merged 2 functions into one by checking amount of arguments
  28. CAS.UnbindAction = CAS.BindAction
  29.  
  30. --This function will trigger the events that have been :Connect()'ed
  31. local function te(self,ev,...)
  32. local t = m[ev]
  33. if t and t._fakeEvent and t.Function then
  34. t.Function(...)
  35. end
  36. end
  37. m.TrigEvent = te
  38. UIS.TrigEvent = te
  39.  
  40. Event.OnServerEvent:Connect(function(plr,io)
  41. if plr~=Player then return end
  42. if io.isMouse then
  43. m.Target = io.Target
  44. m.Hit = io.Hit
  45. else
  46. local b = io.UserInputState == Enum.UserInputState.Begin
  47. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  48. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  49. end
  50. for _,t in pairs(CAS.Actions) do
  51. for _,k in pairs(t.Keys) do
  52. if k==io.KeyCode then
  53. t.Function(t.Name,io.UserInputState,io)
  54. end
  55. end
  56. end
  57. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  58. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  59. end
  60. end)
  61. Event.Parent = NLS([==[
  62. local Player = game:GetService("Players").LocalPlayer
  63. local Event = script:WaitForChild("UserInput_Event")
  64.  
  65. local UIS = game:GetService("UserInputService")
  66. local input = function(io,a)
  67. if a then return end
  68. --Since InputObject is a client-side instance, we create and pass table instead
  69. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  70. end
  71. UIS.InputBegan:Connect(input)
  72. UIS.InputEnded:Connect(input)
  73.  
  74. local Mouse = Player:GetMouse()
  75. local h,t
  76. --Give the server mouse data 30 times every second, but only if the values changed
  77. --If player is not moving their mouse, client won't fire events
  78. while wait(1/30) do
  79. if h~=Mouse.Hit or t~=Mouse.Target then
  80. h,t=Mouse.Hit,Mouse.Target
  81. Event:FireServer({isMouse=true,Target=t,Hit=h})
  82. end
  83. end]==],Player.Character)
  84. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  85. end
  86. ---------------------------------------------------
  87. ---------------The mysterious button---------------
  88. ---------------------------------------------------
  89.  
  90. --Made by mrfunnylaughs4. This sure is some weird button.
  91.  
  92. local debounce = false
  93.  
  94. ---------------------------------------------------
  95. ---------------------Functions---------------------
  96. ---------------------------------------------------
  97.  
  98. local function SmoothPart(part)
  99. part.TopSurface = "Smooth"
  100. part.BottomSurface = "Smooth"
  101. part.LeftSurface = "Smooth"
  102. part.RightSurface = "Smooth"
  103. part.FrontSurface = "Smooth"
  104. part.BackSurface = "Smooth"
  105. end
  106.  
  107. local function Effect(Length, Type, SizeStart, SizeEnd, Position, Colour, Parent, CanCollide)
  108. local part = Instance.new("Part")
  109. part.Name = Type
  110. part.CFrame = Position
  111. part.CanCollide = CanCollide or false
  112. part.Size = SizeStart
  113. part.Anchored = true
  114. part.BrickColor = BrickColor.new(tostring(Colour))
  115. part.Parent = Parent or workspace
  116. if Type == "Block" then
  117. SmoothPart(part)
  118. end
  119. if Type == "Sphere" then
  120. part.Shape = Enum.PartType.Ball
  121. SmoothPart(part)
  122. end
  123. if Type == "TwirlSwirl" then
  124. local mesh = Instance.new("SpecialMesh")
  125. mesh.MeshType = Enum.MeshType.FileMesh
  126. mesh.MeshId = "rbxassetid://662585058"
  127. mesh.Name = "SwirlMesh"
  128. mesh.Scale = SizeStart / Vector3.new(500, 500, 500)
  129. mesh.Parent = part
  130. end
  131. if Type == "Wave" or Type == "SpiralWave" then
  132. local mesh = Instance.new("SpecialMesh")
  133. mesh.MeshType = Enum.MeshType.FileMesh
  134. mesh.MeshId = "rbxassetid://20329976"
  135. mesh.Name = "WaveMesh"
  136. mesh.Scale = SizeStart / Vector3.new(4, 4, 4)
  137. mesh.Parent = part
  138. end
  139. if Type == "MeshSphere" then
  140. local mesh = Instance.new("SpecialMesh")
  141. mesh.MeshType = Enum.MeshType.Sphere
  142. mesh.Parent = part
  143. SmoothPart(part)
  144. end
  145. spawn(function()
  146. local TwirlAngle = math.random(-250, 250) / 1000
  147. local WaveAngle = math.random(-500, 500) / 1000
  148. for i = 1, Length do
  149. game:GetService("RunService").Heartbeat:Wait()
  150. part.Transparency = part.Transparency + 1 / Length
  151. part.Size = part.Size + SizeEnd / Vector3.new(Length, Length, Length)
  152. if Type == "TwirlSwirl" then
  153. part.CFrame = part.CFrame * CFrame.Angles(TwirlAngle, TwirlAngle, TwirlAngle)
  154. part.SwirlMesh.Scale = part.SwirlMesh.Scale + SizeEnd / Vector3.new(Length * 500, Length * 500, Length * 500)
  155. end
  156. if Type == "SpiralWave" then
  157. part.CFrame = part.CFrame * CFrame.Angles(WaveAngle, WaveAngle, WaveAngle)
  158. part.WaveMesh.Scale = part.WaveMesh.Scale + SizeEnd / Vector3.new(Length * 4, Length * 4, Length * 4)
  159. end
  160. if Type == "Wave" then
  161. part.CFrame = part.CFrame * CFrame.Angles(0, WaveAngle, 0)
  162. part.WaveMesh.Scale = part.WaveMesh.Scale + SizeEnd / Vector3.new(Length * 4, Length * 4, Length * 4)
  163. end
  164. end
  165. part:Destroy()
  166. end)
  167. end
  168.  
  169. ---------------------------------------------------
  170. -----------------Making the button-----------------
  171. ---------------------------------------------------
  172.  
  173. local model = Instance.new("Model")
  174. model.Name = "Button"
  175. model.Parent = workspace
  176. local base = Instance.new("Part")
  177. base.Name = "Base"
  178. base.Size = Vector3.new(1, 4, 4)
  179. base.Shape = Enum.PartType.Cylinder
  180. base.CFrame = CFrame.new(0, 0.5, 0, 0, 0, 1, -1, 0, 0, 0, -1, 0)
  181. base.BrickColor = BrickColor.new("Medium stone grey")
  182. base.Anchored = true
  183. base.Locked = true
  184. SmoothPart(base)
  185. base.Parent = model
  186. local button = Instance.new("Part")
  187. button.Name = "Button"
  188. button.Size = Vector3.new(1, 3.4, 3.4)
  189. button.Shape = Enum.PartType.Cylinder
  190. button.CFrame = CFrame.new(1.49011612e-08, 0.799999952, 0, -0, -0, 1, -1, -0, 0, -0, -1, 0)
  191. button.BrickColor = BrickColor.new("Bright red")
  192. button.Anchored = true
  193. button.Locked = true
  194. SmoothPart(button)
  195. button.Parent = model
  196. local click = Instance.new("ClickDetector")
  197. click.Name = "MouseClickDetect"
  198. click.MaxActivationDistance = 8
  199. click.Parent = button
  200.  
  201. ---------------------------------------------------
  202. ----------------------Attacks----------------------
  203. ---------------------------------------------------
  204.  
  205. game:GetService("RunService").Heartbeat:Connect(function()
  206. if not click:FindFirstChild("EventHooked") then
  207. local val = Instance.new("BoolValue")
  208. val.Name = "EventHooked"
  209. val.Parent = click
  210. click.MouseClick:Connect(function(player)
  211. if debounce == false then
  212. debounce = true
  213. local sound = Instance.new("Sound")
  214. sound.SoundId = "rbxassetid://1677936333"
  215. sound.Volume = 5
  216. sound.Parent = button
  217. sound:Play()
  218. button.CFrame = button.CFrame + Vector3.new(0, -0.15, 0)
  219. wait(0.2)
  220. button.CFrame = button.CFrame + Vector3.new(0, 0.15, 0)
  221. wait(0.05)
  222. local sound2 = Instance.new("Sound")
  223. sound2.SoundId = "rbxassetid://1274525620"
  224. sound2.Volume = 5
  225. sound2.Parent = button
  226. sound2:Play()
  227. wait(1.55)
  228. sound:Destroy()
  229. sound2:Destroy()
  230. local choice = math.random(1, 4)
  231. if choice == 1 then
  232. local Char = player.Character
  233. local sound = Instance.new("Sound")
  234. sound.SoundId = "rbxassetid://130972023"
  235. sound.Volume = 5
  236. sound.Parent = Char.HumanoidRootPart
  237. sound:Play()
  238. Effect(40, "Sphere", Vector3.new(2, 2, 2), Vector3.new(15, 15, 15), Char.HumanoidRootPart.CFrame, BrickColor.new("Really black"), Char)
  239. for i = 1, 4 do
  240. Effect(40, "SpiralWave", Vector3.new(10, 2, 10), Vector3.new(40, 8, 40), Char.HumanoidRootPart.CFrame, BrickColor.new("Really black"), Char)
  241. end
  242. for i,v in pairs(Char:GetChildren()) do
  243. if v:IsA("BasePart") and not v:IsA("Terrain") then
  244. v:BreakJoints()
  245. v.Velocity = Vector3.new(math.random(-25, 25), 30, math.random(-25, 25))
  246. end
  247. end
  248. elseif choice == 2 then
  249. local Char = player.Character
  250. local sound = Instance.new("Sound")
  251. sound.SoundId = "rbxassetid://1368583274"
  252. sound.Volume = 5
  253. sound.Parent = Char.HumanoidRootPart
  254. sound:Play()
  255. for i = 1, 120 do
  256. game:GetService("RunService").Heartbeat:Wait()
  257. sound.Volume = sound.Volume - 5 / 120
  258. Effect(15, "Wave", Vector3.new(7, 1, 7), Vector3.new(20, 4, 20), Char.HumanoidRootPart.CFrame + Vector3.new(0, -2.5, 0), BrickColor.new("Mid gray"), Char)
  259. end
  260. sound:Destroy()
  261. local sound = Instance.new("Sound")
  262. sound.SoundId = "rbxassetid://165970126"
  263. sound.Volume = 2
  264. sound.Parent = Char.HumanoidRootPart
  265. sound:Play()
  266. Effect(20, "MeshSphere", Vector3.new(5, 15, 5), Vector3.new(8, 90, 8), Char.HumanoidRootPart.CFrame, BrickColor.new("Institutional white"), Char)
  267. for i = 1, 4 do
  268. Effect(30, "Wave", Vector3.new(7, 1, 7), Vector3.new(40, 8, 40), Char.HumanoidRootPart.CFrame + Vector3.new(0, -2.5, 0), BrickColor.new("Mid gray"), Char)
  269. end
  270. local vel = Instance.new("BodyVelocity")
  271. vel.MaxForce = Vector3.new(1e9, 1e9, 1e9)
  272. vel.Velocity = Vector3.new(0, 300, 0)
  273. vel.Parent = Char.HumanoidRootPart
  274. spawn(function()
  275. wait(0.5)
  276. vel:Destroy()
  277. end)
  278. elseif choice == 3 then
  279. local Char = player.Character
  280. local hole = Instance.new("Part")
  281. hole.Name = "Hole"
  282. hole.Color = Color3.new(0, 0, 0)
  283. hole.Shape = Enum.PartType.Cylinder
  284. hole.CFrame = Char.HumanoidRootPart.CFrame * CFrame.new(0, -3.04, 0) * CFrame.Angles(0, 0, math.pi / 2)
  285. hole.Size = Vector3.new(0.1, 0, 0)
  286. hole.Anchored = true
  287. hole.Locked = true
  288. hole.Material = Enum.Material.Neon
  289. hole.CanCollide = false
  290. SmoothPart(hole)
  291. hole.Parent = Char
  292. Char.Head.Anchored = true
  293. for i = 1, 35 do
  294. game:GetService("RunService").Heartbeat:Wait()
  295. hole.Size = hole.Size + Vector3.new(0, 0.2 * Char.HumanoidRootPart.Size.Z, 0.2 * Char.HumanoidRootPart.Size.Z)
  296. end
  297. local sound = Instance.new("Sound")
  298. sound.SoundId = "rbxassetid://838038142"
  299. sound.Volume = 2
  300. sound.Parent = Char.HumanoidRootPart
  301. sound:Play()
  302. repeat
  303. game:GetService("RunService").Heartbeat:Wait()
  304. Char:SetPrimaryPartCFrame(Char.Head.CFrame * CFrame.new(0, -0.05, 0))
  305. hole.CFrame = hole.CFrame + Vector3.new(0, 0.05, 0)
  306. until Char.HumanoidRootPart.Position.Y < hole.Position.Y - 3.4 * Char.HumanoidRootPart.Size.Z
  307. sound:Destroy()
  308. for i = 1, 35 do
  309. game:GetService("RunService").Heartbeat:Wait()
  310. hole.Size = hole.Size - Vector3.new(0, 0.2 * Char.HumanoidRootPart.Size.Z, 0.2 * Char.HumanoidRootPart.Size.Z)
  311. end
  312. hole:Destroy()
  313. Char:BreakJoints()
  314. elseif choice == 4 then
  315. local Char = player.Character
  316. local sound = Instance.new("Sound")
  317. sound.SoundId = "rbxassetid://130972023"
  318. sound.Volume = 5
  319. sound.Parent = Char.HumanoidRootPart
  320. sound:Play()
  321. if Char:FindFirstChildOfClass("Humanoid") then
  322. for i = 1, 5 do
  323. Effect(30, "Wave", Vector3.new(7, 1, 7), Vector3.new(20, 4, 20), Char.HumanoidRootPart.CFrame + Vector3.new(0, -2.5, 0), BrickColor.new("Mid gray"), Char)
  324. end
  325. Char:FindFirstChildOfClass("Humanoid").PlatformStand = true
  326. else
  327. for i = 1, 5 do
  328. Effect(30, "Wave", Vector3.new(7, 1, 7), Vector3.new(20, 4, 20), Char.HumanoidRootPart.CFrame + Vector3.new(0, -2.5, 0), BrickColor.new("Mid gray"), Char)
  329. end
  330. local bodyforce = Instance.new("BodyForce")
  331. bodyforce.Force = Vector3.new(0, -500000, 0)
  332. bodyforce.Parent = Char.Head
  333. end
  334. end
  335. debounce = false
  336. end
  337. end)
  338. end
  339. end)
  340.  
  341. ---------------------------------------------------
  342. --------------------Wrapping up--------------------
  343. ---------------------------------------------------
  344.  
  345. while game:GetService("RunService").Heartbeat:Wait() do
  346. if model.Parent ~= workspace then
  347. model = Instance.new("Model")
  348. model.Name = "Button"
  349. base = Instance.new("Part")
  350. base.Name = "Base"
  351. base.Size = Vector3.new(1, 4, 4)
  352. base.Shape = Enum.PartType.Cylinder
  353. base.CFrame = CFrame.new(0, 0.5, 0, 0, 0, 1, -1, 0, 0, 0, -1, 0)
  354. base.BrickColor = BrickColor.new("Medium stone grey")
  355. base.Anchored = true
  356. base.Locked = true
  357. SmoothPart(base)
  358. base.Parent = model
  359. button = Instance.new("Part")
  360. button.Name = "Button"
  361. button.Size = Vector3.new(1, 3.4, 3.4)
  362. button.Shape = Enum.PartType.Cylinder
  363. button.CFrame = CFrame.new(1.49011612e-08, 0.799999952, 0, -0, -0, 1, -1, -0, 0, -0, -1, 0)
  364. button.BrickColor = BrickColor.new("Bright red")
  365. button.Anchored = true
  366. button.Locked = true
  367. SmoothPart(button)
  368. button.Parent = model
  369. click = Instance.new("ClickDetector")
  370. click.Name = "MouseClickDetect"
  371. click.MaxActivationDistance = 8
  372. click.Parent = button
  373. model.Parent = workspace
  374. end
  375. if base.Parent ~= model then
  376. base = Instance.new("Part")
  377. base.Name = "Base"
  378. base.Size = Vector3.new(1, 4, 4)
  379. base.Shape = Enum.PartType.Cylinder
  380. base.CFrame = CFrame.new(0, 0.5, 0, 0, 0, 1, -1, 0, 0, 0, -1, 0)
  381. base.BrickColor = BrickColor.new("Medium stone grey")
  382. base.Anchored = true
  383. base.Locked = true
  384. SmoothPart(base)
  385. base.Parent = model
  386. end
  387. if button.Parent ~= model then
  388. button = Instance.new("Part")
  389. button.Name = "Button"
  390. button.Size = Vector3.new(1, 3.4, 3.4)
  391. button.Shape = Enum.PartType.Cylinder
  392. button.CFrame = CFrame.new(1.49011612e-08, 0.799999952, 0, -0, -0, 1, -1, -0, 0, -0, -1, 0)
  393. button.BrickColor = BrickColor.new("Bright red")
  394. button.Anchored = true
  395. button.Locked = true
  396. SmoothPart(button)
  397. button.Parent = model
  398. end
  399. if click.Parent ~= button then
  400. click = Instance.new("ClickDetector")
  401. click.Name = "MouseClickDetect"
  402. click.MaxActivationDistance = 8
  403. click.Parent = button
  404. model.Parent = workspace
  405. end
  406. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement