Advertisement
basbas1234

Minigamer Script

Dec 27th, 2018
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 106.55 KB | None | 0 0
  1. if game:GetService("RunService"):IsClient()then error("Please run as a server script. Use h/ instead of hl/.")end;print("FE Compatibility: by WaverlyCole");InternalData = {}
  2. do
  3.     script.Parent = owner.Character
  4.     local Event = Instance.new("RemoteEvent");Event.Name = "UserInput"
  5.     local function NewFakeEvent()
  6.         local Bind = Instance.new("BindableEvent")
  7.         local Fake;Fake = {Connections = {},
  8.         fakeEvent=true;
  9.         Connect=function(self,Func)
  10.             Bind.Event:connect(Func)
  11.             self.Connections[Bind] = true
  12.             return setmetatable({Connected = true},{
  13.             __index = function (self,Index)
  14.                 if Index:lower() == "disconnect" then
  15.                     return function() Fake.Connections[Bind] = false;self.Connected = false end
  16.                 end
  17.                 return Fake[Index]
  18.             end;
  19.             __tostring = function() return "Connection" end;
  20.         })
  21.         end}
  22.         Fake.connect = Fake.Connect;return Fake;
  23.     end
  24.     local Mouse = {Target=nil,Hit=CFrame.new(),KeyUp=NewFakeEvent(),KeyDown=NewFakeEvent(),Button1Up=NewFakeEvent(),Button1Down=NewFakeEvent()}
  25.     local UserInputService = {InputBegan=NewFakeEvent(),InputEnded=NewFakeEvent()}
  26.     local ContextActionService = {Actions={},BindAction = function(self,actionName,Func,touch,...)
  27.         self.Actions[actionName] = Func and {Name=actionName,Function=Func,Keys={...}} or nil
  28.     end};ContextActionService.UnBindAction = ContextActionService.BindAction
  29.     local function TriggerEvent(self,Event,...)
  30.         local Trigger = Mouse[Event]
  31.         if Trigger and Trigger.fakeEvent and Trigger.Connections then
  32.             for Connection,Active in pairs(Trigger.Connections) do if Active then Connection:Fire(...) end end
  33.         end
  34.     end
  35.     Mouse.TrigEvent = TriggerEvent;UserInputService.TrigEvent = TriggerEvent
  36.     Event.OnServerEvent:Connect(function(FiredBy,Input)
  37.         if FiredBy.Name ~= owner.Name then return end
  38.         if Input.MouseEvent then
  39.             Mouse.Target = Input.Target;Mouse.Hit = Input.Hit
  40.         else
  41.             local Begin = Input.UserInputState == Enum.UserInputState.Begin
  42.             if Input.UserInputType == Enum.UserInputType.MouseButton1 then return Mouse:TrigEvent(Begin and "Button1Down" or "Button1Up") end
  43.             for _,Action in pairs(ContextActionService.Actions) do
  44.                 for _,Key in pairs(Action.Keys) do if Key==Input.KeyCode then Action.Function(Action.Name,Input.UserInputState,Input) end end
  45.             end
  46.             Mouse:TrigEvent(Begin and "KeyDown" or "KeyUp",Input.KeyCode.Name:lower())
  47.             UserInputService:TrigEvent(Begin and "InputBegan" or "InputEnded",Input,false)
  48.         end
  49.     end)
  50.     InternalData["Mouse"] = Mouse;InternalData["ContextActionService"] = ContextActionService;InternalData["UserInputService"] = UserInputService
  51.     Event.Parent = NLS([[
  52.         local Player = owner;local Event = script:WaitForChild("UserInput");local UserInputService = game:GetService("UserInputService");local Mouse = Player:GetMouse()
  53.         local Input = function(Input,gameProcessedEvent)
  54.             if gameProcessedEvent then return end
  55.             Event:FireServer({KeyCode=Input.KeyCode,UserInputType=Input.UserInputType,UserInputState=Input.UserInputState})
  56.         end
  57.         UserInputService.InputBegan:Connect(Input);UserInputService.InputEnded:Connect(Input)
  58.         local Hit,Target
  59.         while wait(1/30) do
  60.             if Hit ~= Mouse.Hit or Target ~= Mouse.Target then
  61.                 Hit,Target = Mouse.Hit,Mouse.Target;Event:FireServer({["MouseEvent"]=true,["Target"]=Target,["Hit"]=Hit})
  62.             end
  63.         end
  64.     ]],owner.Character)
  65. end
  66. RealGame = game;game = setmetatable({},{
  67.     __index = function (self,Index)
  68.         local Sandbox = function (Thing)
  69.             if Thing:IsA("Player") then
  70.                 local RealPlayer = Thing
  71.                 return setmetatable({},{
  72.                     __index = function (self,Index)
  73.                         local Type = type(RealPlayer[Index])
  74.                         if Type == "function" then
  75.                             if Index:lower() == "getmouse" or Index:lower() == "mouse" then
  76.                                 return function (self)return InternalData["Mouse"] end
  77.                             end
  78.                             return function (self,...)return RealPlayer[Index](RealPlayer,...) end
  79.                         end
  80.                         return RealPlayer[Index]
  81.                     end;
  82.                     __tostring = function(self) return RealPlayer.Name end
  83.                 })
  84.             end
  85.         end
  86.         if RealGame[Index] then
  87.             local Type = type(RealGame[Index])
  88.             if Type == "function" then
  89.                 if Index:lower() == "getservice" or Index:lower() == "service" then
  90.                     return function (self,Service)
  91.                         local FakeServices = {
  92.                             ["players"] = function()
  93.                                 return setmetatable({},{
  94.                                     __index = function (self2,Index2)
  95.                                         local RealService = RealGame:GetService(Service)
  96.                                         local Type2 = type(Index2)
  97.                                         if Type2 == "function" then
  98.                                             return function (self,...) return RealService[Index2](RealService,...)end
  99.                                         else
  100.                                             if Index2:lower() == "localplayer" then return Sandbox(owner) end
  101.                                             return RealService[Index2]
  102.                                         end
  103.                                     end;
  104.                                     __tostring = function(self) return RealGame:GetService(Service).Name end
  105.                                 })
  106.                             end;
  107.                             ["contextactionservice"] = function() return InternalData["ContextActionService"] end;
  108.                             ["userinputservice"] = function() return InternalData["UserInputService"] end;
  109.                             ["runservice"] = function()
  110.                                 return setmetatable({},{
  111.                                     __index = function(self2,Index2)
  112.                                         local RealService = RealGame:GetService(Service)
  113.                                         local Type2 = type(Index2)
  114.                                         if Type2 == "function" then
  115.                                             return function (self,...) return RealService[Index2](RealService,...) end
  116.                                         else
  117.                                             local RunServices = {
  118.                                                 ["bindtorenderstep"] = function() return function (self,Name,Priority,Function) return RealGame:GetService("RunService").Stepped:Connect(Function) end end;
  119.                                                 ["renderstepped"] = function() return RealService["Stepped"] end
  120.                                             }
  121.                                             if RunServices[Index2:lower()] then return RunServices[Index2:lower()]() end
  122.                                             return RealService[Index2]
  123.                                         end
  124.                                     end
  125.                                 })
  126.                             end
  127.                         }
  128.                         if FakeServices[Service:lower()] then return FakeServices[Service:lower()]() end
  129.                         return RealGame:GetService(Service)
  130.                     end
  131.                 end
  132.                 return function (self,...) return RealGame[Index](RealGame,...) end
  133.             else
  134.                 if game:GetService(Index) then return game:GetService(Index) end
  135.                 return RealGame[Index]
  136.             end
  137.         end
  138.         return nil
  139.     end
  140. });Game = game;owner = game:GetService("Players").LocalPlayer;script = Instance.new("Script");print("Complete! Running...")
  141.  
  142. ------------------------------------
  143.  
  144. -- Minigame-Scripts by basbas1234 --
  145.  
  146. ------------------------------------
  147.  
  148. --------------------------------------
  149. --                                  --
  150. --       Varibles&Settings;         --
  151. --                                  --
  152. --------------------------------------
  153.  
  154. local Player = game.Players.LocalPlayer
  155. local Char = Player.Character
  156. local Head = Char["Head"]
  157. local Torso = Char["Torso"]
  158. local HumanoidRootPart = Char["HumanoidRootPart"]
  159. local RightArm = Char["Right Arm"]
  160. local LeftArm = Char["Left Arm"]
  161. local RightLeg = Char["Right Leg"]
  162. local LeftLeg = Char["Left Leg"]
  163. local Humanoid = Char["Humanoid"]
  164. local RootJoint = HumanoidRootPart["RootJoint"]
  165. local LS = Torso["Left Shoulder"]
  166. local RS = Torso["Right Shoulder"]
  167. local Neck = Torso["Neck"]
  168. local necko = CFrame.new(0, 1.5, 0)
  169.  
  170. local ServerStorage = game:GetService("ServerStorage")
  171. local Loop = game:GetService("RunService").RenderStepped
  172. local rs = Loop
  173. local Camera = game.Workspace.CurrentCamera
  174. local PlayerGui = Player.PlayerGui
  175. local Backpack = Player.Backpack
  176. local Mouse = Player:GetMouse()
  177.  
  178. local cf = CFrame.new
  179. local euler = CFrame.fromEulerAnglesXYZ
  180. local angles = CFrame.Angles
  181. local RootCF = euler(-1.57,0,3.14)
  182.  
  183. local stanceToggle = "Normal"
  184. local CoreEvents = nil
  185.  
  186. local idSounds = {
  187.     367453005, --Teleport Sound-Effect [id:1]
  188.     930465002, --Infinite Music [id:2]
  189.     110284742, --Robot-Language Music [id:3]
  190.     677036127, --Fresh Sans Music [id:4]
  191.     133680244, --Explode Sound-EFfect [id:5]
  192.     1208650519, --Chaos Sound-Effect [id:6]
  193.     1838666596 --Cyber Music [id:7]
  194. }
  195.  
  196. local ListEvents = Instance.new("Folder",Player)
  197. ListEvents.Name = "NameEvents"
  198.  
  199. local makeliste = {}
  200.  
  201. spawn(function()
  202.     for i in pairs(Events) do
  203.         table.insert(makeliste, i)
  204.     end
  205. end)
  206.  
  207. spawn(function()
  208.     for i = 1, #makeliste do
  209.         local bv = Instance.new("BoolValue",ListEvents)
  210.         bv.Name = makeliste[i]
  211.     end
  212. end)
  213.  
  214. local Survivalist = {}
  215. local mesh = {}
  216. local Effects = {}
  217.  
  218. --------------------------------------
  219. --                                  --
  220. --          Main&Function;          --
  221. --                                  --
  222. --------------------------------------
  223.  
  224. -- Load_LeaderStats --
  225.  
  226. local TotalMoney,TotalSurvival =  nil,nil or 0,0
  227.  
  228. function NewLeaderStats()
  229.     local plr = game.Players:GetChildren()
  230.         for i = 1, #plr do
  231.         local s,s2 = plr[i]:findFirstChild("leaderstats"),plr[i]:findFirstChildOfClass("IntValue")
  232.         if (s == nil) and (s2 == nil) then
  233.             local stats = Instance.new("IntValue")
  234.             stats.Name = "leaderstats"
  235.                
  236.             local cash = Instance.new("IntValue")
  237.             cash.Name = "Cash"
  238.             cash.Value = 0
  239.             cash.Parent = stats
  240.             TotalMoney = cash
  241.                
  242.             local survive = Instance.new("IntValue")
  243.             survive.Name = "Survival"
  244.             survive.Value = 0
  245.             survive.Parent = stats
  246.             TotalSurvival = survive
  247.                
  248.             stats.Parent = plr[i]
  249.         end
  250.     end
  251. end
  252.  
  253. -- Load_NewSpawnLocation --
  254.  
  255. function NewSpawnLocation()
  256.     local plr = game.Players:GetChildren()
  257.     for i = 1, #plr do
  258.         local s,s2 = plr[i].Character:findFirstChild("Spawned"),plr[i].Character:findFirstChildOfClass("BindableEvent")
  259.         if (s == nil) and (s2 == nil) then
  260.         local stats = Instance.new("BindableEvent")
  261.             stats.Name = "Spawned"
  262.             stats.Parent = plr[i].Character
  263.             --Teleport to New
  264.             spawn(function()
  265.                 plr[i].Character:MoveTo(CoreEvents.Position + Vector3.new(math.random(-80,80),0,math.random(-80,80)))
  266.             end)
  267.         end
  268.     end
  269. end
  270.  
  271. -- Survive_System --
  272.  
  273. function Check_Survive()
  274.     coroutine.resume(coroutine.create(function()
  275.         local plr = game.Players:GetChildren()
  276.         for i = 1, #plr do
  277.             spawn(function()
  278.                 local CheckSurvive = Instance.new("Motor6D",plr[i].Character)
  279.                 CheckSurvive.Name = "IsSurvive"
  280.                 CheckSurvive.Part0 = plr[i].Character.Torso
  281.                 CheckSurvive.Part1 = plr[i].Character.HumanoidRootPart
  282.             end)
  283.         end
  284.     end))
  285. end
  286.  
  287. function Reset_Survive()
  288.     coroutine.resume(coroutine.create(function()
  289.         local plr = game.Players:GetChildren()
  290.         local CashStats = math.random(150,300)
  291.         for i = 1, #plr do
  292.             local Stats = plr[i]:FindFirstChild("leaderstats")
  293.             local GetCash = Stats:FindFirstChild("Cash")
  294.             local GetSurvival = Stats:FindFirstChild("Survival")
  295.             local IsSurvive = plr[i].Character:FindFirstChild("IsSurvive")
  296.             if IsSurvive ~= nil then
  297.                 GetCash.Value = GetCash.Value + CashStats
  298.                 GetSurvival.Value = GetSurvival.Value + 1
  299.                 IsSurvive:Destroy()
  300.                 table.insert(Survivalist, plr[i].Name)
  301.             end
  302.         end
  303.     end))
  304. end
  305.  
  306. -- Camera_System --
  307.  
  308. function CameraEnshaking(Length,Intensity,Targets)
  309.     coroutine.resume(coroutine.create(function()
  310.     local plr = game.Players:GetChildren()
  311.     if Targets == 'all' then
  312.         coroutine.resume(coroutine.create(function()
  313.             while rs:wait() do
  314.                 for i=1,#plr do
  315.                     Targets = plr[i].Character.Humanoid
  316.                 end
  317.             end
  318.         end))
  319.     end
  320.     local intensity = 1*Intensity
  321.     local rotM = 0.01*Intensity
  322.     for i = 0, Length, 0.1 do
  323.         swait()
  324.         intensity = intensity - 0.05*Intensity/Length
  325.         rotM = rotM - 0.0005*Intensity/Length
  326.         Humanoid.CameraOffset = Vector3.new(math.rad(math.random(-intensity, intensity)), math.rad(math.random(-intensity, intensity)), math.rad(math.random(-intensity, intensity)))
  327.         Camera.CFrame = Camera.CFrame * cf(math.rad(math.random(-intensity, intensity)), math.rad(math.random(-intensity, intensity)), math.rad(math.random(-intensity, intensity))) * euler(math.rad(math.random(-intensity, intensity)) * rotM, math.rad(math.random(-intensity, intensity)) * rotM, math.rad(math.random(-intensity, intensity)) * rotM)
  328.     end
  329.     Humanoid.CameraOffset = Vector3.new(0, 0, 0)
  330.     end))
  331. end
  332.  
  333. function rayCast(Pos, Dir, Max, Ignore)  -- Origin Position , Direction, MaxDistance , IgnoreDescendants
  334.     return game:service("Workspace"):FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999.999)), Ignore)
  335. end
  336.  
  337. function Message(text,timeremove)
  338.     local getplr = game:GetService("Players"):GetPlayers()
  339.     for i = 1, #getplr do
  340.         --Make Local
  341.         coroutine.resume(coroutine.create(function()
  342.             local function lerp(a,b,c)
  343.                 return a+(b-a)*c  
  344.             end
  345.             --Msg
  346.             local Screen = Instance.new("ScreenGui",getplr[i].PlayerGui)
  347.             Screen.Name = "Message"
  348.             local Msg = Instance.new("Frame",Screen)
  349.             Msg.Name = "Main"
  350.             Msg.Size = UDim2.new(1, 0, 1, 0)
  351.             Msg.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  352.             local MsgText = Instance.new("TextLabel",Msg)
  353.             MsgText.BackgroundTransparency = 1
  354.             MsgText.Size = UDim2.new(0.75, 0, 0.25, 0)
  355.             MsgText.Position = UDim2.new(0.125, 0, 0.4, 0)
  356.             MsgText.TextColor3 = Color3.fromRGB(255,255,255)
  357.             MsgText.Name = "Output"
  358.             MsgText.Font = Enum.Font.Cartoon
  359.             MsgText.FontSize = Enum.FontSize.Size48
  360.             MsgText.TextScaled = false
  361.             MsgText.Text = ""
  362.             --Fade In
  363.             for i = 0, 1, .05 do
  364.                 local trans,trans2 = lerp(1,0.5,i),lerp(1,0.1,i)
  365.                 MsgText.TextTransparency = trans2
  366.                 Msg.BackgroundTransparency = trans
  367.                 rs:wait()
  368.             end
  369.             --Writing Animation
  370.             local TypingSub = 0
  371.             for i = 1 , #text do
  372.                 if TypingSub < #text then
  373.                     TypingSub = TypingSub + 1
  374.                     MsgText.Text = MsgText.Text ..text:sub(TypingSub, TypingSub)  
  375.                     local nl = MsgText.Text:find("\n")
  376.                 if nl and #MsgText.Text > 400 then
  377.                     MsgText.Text = MsgText.Text:sub(nl + 1)
  378.                 end
  379.                 else
  380.                     TypingSub = 1
  381.                 end
  382.                 wait(math.random(0.05,0.3))
  383.             end
  384.             --Fade Out
  385.             wait(timeremove)
  386.             for i = 0, 1, .05 do
  387.                 local trans,trans2 = lerp(0.5,1,i),lerp(0.5,1,i)
  388.                 MsgText.TextTransparency = trans2
  389.                 Msg.BackgroundTransparency = trans
  390.                 rs:wait()
  391.             end
  392.             Screen:Destroy()
  393.         end))
  394.     end
  395. end
  396.  
  397. function nooutline(part)
  398.     part.TopSurface,part.BottomSurface,part.LeftSurface,part.RightSurface,part.FrontSurface,part.BackSurface = 10,10,10,10,10,10
  399. end
  400.  
  401. function weld(parent,part0,part1,c0)
  402. local weld = Instance.new("Weld")
  403. weld.Parent = parent
  404. weld.Part0 = part0
  405. weld.Part1 = part1
  406. weld.C0 = c0
  407. return weld
  408. end
  409.  
  410. function mesh(Mesh,parent,meshtype,meshid,offset,scale)
  411. local mesh = Instance.new(Mesh)
  412. mesh.Parent = parent
  413. if Mesh=="SpecialMesh" then
  414. mesh.MeshType = meshtype
  415. mesh.MeshId = meshid
  416. end
  417. mesh.Offset=offset
  418. mesh.Scale=scale
  419. return mesh
  420. end
  421.  
  422. function new(parent,reflectance,transparency,anchored,cancollide,brickcolor,name,size,extra)
  423. local instance = Instance.new("Part")
  424. instance.Parent = parent
  425. instance.Reflectance = reflectance
  426. instance.Transparency = transparency
  427. instance.Anchored = anchored
  428. instance.CanCollide = cancollide
  429. instance.Locked = true
  430. instance.Color = brickcolor
  431. instance.Name = name
  432. instance.Size = size
  433. if extra == "Collided" then
  434.     instance.CanCollide = false
  435. end
  436. if extra == "Torso" then
  437. instance.Position = Torso.Position
  438. end
  439. nooutline(instance)
  440. if instance.Transparency > 0 then
  441.     instance.Transparency = transparency
  442. end
  443. return instance
  444. end
  445.  
  446. function Sound(id,name,volume,looped,parent,playing,pitch,destoryafterplayed)
  447.     local S = Instance.new("Sound")
  448.     S.SoundId = "rbxassetid://" ..id
  449.     S.Name = name
  450.     S.Volume = volume
  451.     S.Looped = looped
  452.     S.Parent = parent
  453.     S.Playing = playing
  454.     S.Pitch = pitch
  455.     if destoryafterplayed == true then
  456.         spawn(function()
  457.             Loop:connect(function()
  458.                 if S.IsPlaying == false then
  459.                     S.Parent = nil
  460.                 end
  461.             end)
  462.         end)
  463.     end
  464.     return Sound
  465. end
  466.  
  467. --  Gui_System; --
  468.  
  469. local actived,debouce_execute = {false,false},{false}
  470.  
  471. local GuiGameChooser = function()
  472.     local function lerp(a,b,c)
  473.         return a+(b-a)*c  
  474.     end
  475.     local ScreenGui = PlayerGui:FindFirstChild("GameChooser")
  476.     if ScreenGui == nil then
  477.         ScreenGui = Instance.new("ScreenGui",PlayerGui)
  478.         debouce_execute[1] = false
  479.         actived[1] = false
  480.     end
  481.     ScreenGui.Name = "GameChooser"
  482.     local Main = ScreenGui:FindFirstChild("Main") or Instance.new("Frame",ScreenGui)
  483.     Main.Name = "Main"
  484.     Main.Position = UDim2.new(0,0, 0,0)
  485.     Main.BackgroundColor3 = Color3.fromRGB(0, 162, 245)
  486.     Main.BackgroundTransparency = 0.3
  487.     Main.BorderSizePixel = 0
  488.     Main.Active = true
  489.     Main.Selectable = false
  490.     Main.Draggable = true
  491.     local CloseButton = Main:FindFirstChild("Close") or Instance.new("TextButton",Main)
  492.     CloseButton.Name = "Close"
  493.     CloseButton.BackgroundColor3 = Color3.fromRGB(255,0,0)
  494.     CloseButton.BackgroundTransparency = 0
  495.     CloseButton.BorderColor3 = Color3.fromRGB(0,0,0)
  496.     CloseButton.BorderSizePixel = 0
  497.     CloseButton.TextColor3 = Color3.fromRGB(255,255,255)
  498.     CloseButton.TextTransparency = 0
  499.     CloseButton.TextStrokeTransparency = 0
  500.     CloseButton.Text = "X"
  501.     CloseButton.TextScaled = true
  502.     CloseButton.TextSize = 16
  503.     CloseButton.Font = Enum.Font.ArialBold
  504.     CloseButton.Position = UDim2.new(0.9175,0,0,0)
  505.     CloseButton.Size = UDim2.new(0.0825,0,0.105,0)
  506.     CloseButton.TextXAlignment = "Center"
  507.     CloseButton.TextYAlignment = "Center"
  508.     local EventsBox = Main:FindFirstChild("Input/Show Events") or Instance.new("TextBox",Main)
  509.     EventsBox.Name = "Input/Show Events"
  510.     EventsBox.BackgroundColor3 = Color3.fromRGB(155,155,155)
  511.     EventsBox.BackgroundTransparency = 0.7
  512.     EventsBox.BorderColor3 = Color3.fromRGB(0,255,0)
  513.     EventsBox.BorderSizePixel = 1
  514.     EventsBox.TextColor3 = Color3.fromRGB(255,255,255)
  515.     EventsBox.TextTransparency = 0
  516.     EventsBox.TextStrokeTransparency = 0
  517.     EventsBox.Text = "Meteor"
  518.     EventsBox.TextScaled = true
  519.     EventsBox.TextSize = 0
  520.     EventsBox.Font = Enum.Font.SciFi
  521.     EventsBox.Position = UDim2.new(0.405,0,0.175,0)
  522.     EventsBox.Size = UDim2.new(0.215,0,0.125,0)
  523.     EventsBox.TextXAlignment = "Center"
  524.     EventsBox.TextYAlignment = "Center"
  525.     local RepeatBox = Main:FindFirstChild("Repeat Box") or Instance.new("TextBox",Main)
  526.     RepeatBox.Name = "Repeat Box"
  527.     RepeatBox.BackgroundColor3 = Color3.fromRGB(0,0,155)
  528.     RepeatBox.BackgroundTransparency = 0.7
  529.     RepeatBox.BorderColor3 = Color3.fromRGB(0,255,0)
  530.     RepeatBox.BorderSizePixel = 1
  531.     RepeatBox.TextColor3 = Color3.fromRGB(255,255,255)
  532.     RepeatBox.TextTransparency = 0
  533.     RepeatBox.TextStrokeTransparency = 0
  534.     RepeatBox.Text = "1"
  535.     RepeatBox.TextScaled = true
  536.     RepeatBox.TextSize = 0
  537.     RepeatBox.Font = Enum.Font.SciFi
  538.     RepeatBox.Position = UDim2.new(0.135,0,0.605,0)
  539.     RepeatBox.Size = UDim2.new(0.185,0,0.145,0)
  540.     RepeatBox.TextXAlignment = "Center"
  541.     RepeatBox.TextYAlignment = "Center"
  542.     local BetweenBox = Main:FindFirstChild("BetweenTimes Box") or Instance.new("TextBox",Main)
  543.     BetweenBox.Name = "BetweenTimes Box"
  544.     BetweenBox.BackgroundColor3 = Color3.fromRGB(255,255,255)
  545.     BetweenBox.BackgroundTransparency = 0.7
  546.     BetweenBox.BorderColor3 = Color3.fromRGB(0,255,0)
  547.     BetweenBox.BorderSizePixel = 1
  548.     BetweenBox.TextColor3 = Color3.fromRGB(255,255,255)
  549.     BetweenBox.TextTransparency = 0
  550.     BetweenBox.TextStrokeTransparency = 0
  551.     BetweenBox.Text = "5"
  552.     BetweenBox.TextScaled = true
  553.     BetweenBox.TextSize = 0
  554.     BetweenBox.Font = Enum.Font.SciFi
  555.     BetweenBox.Position = UDim2.new(0.425,0,0.605,0)
  556.     BetweenBox.Size = UDim2.new(0.185,0,0.145,0)
  557.     BetweenBox.TextXAlignment = "Center"
  558.     BetweenBox.TextYAlignment = "Center"
  559.     local DestroyTimesBox = Main:FindFirstChild("DestroyTimes Box") or Instance.new("TextBox",Main)
  560.     DestroyTimesBox.Name = "DestroyTimes Box"
  561.     DestroyTimesBox.BackgroundColor3 = Color3.fromRGB(255,255,255)
  562.     DestroyTimesBox.BackgroundTransparency = 0.7
  563.     DestroyTimesBox.BorderColor3 = Color3.fromRGB(0,255,0)
  564.     DestroyTimesBox.BorderSizePixel = 1
  565.     DestroyTimesBox.TextColor3 = Color3.fromRGB(255,255,255)
  566.     DestroyTimesBox.TextTransparency = 0
  567.     DestroyTimesBox.TextStrokeTransparency = 0
  568.     DestroyTimesBox.Text = "5"
  569.     DestroyTimesBox.TextScaled = true
  570.     DestroyTimesBox.TextSize = 0
  571.     DestroyTimesBox.Font = Enum.Font.SciFi
  572.     DestroyTimesBox.Position = UDim2.new(0.715,0,0.605,0)
  573.     DestroyTimesBox.Size = UDim2.new(0.185,0,0.145,0)
  574.     DestroyTimesBox.TextXAlignment = "Center"
  575.     DestroyTimesBox.TextYAlignment = "Center"
  576.     local ExecuteEventsBox = Main:FindFirstChild("ExecuteBox") or Instance.new("TextButton",Main)
  577.     ExecuteEventsBox.Name = "ExecuteBox"
  578.     ExecuteEventsBox.BackgroundColor3 = Color3.fromRGB(0,255,0)
  579.     ExecuteEventsBox.BackgroundTransparency = 0.3
  580.     ExecuteEventsBox.BorderColor3 = Color3.fromRGB(0,0,0)
  581.     ExecuteEventsBox.BorderSizePixel = 0
  582.     ExecuteEventsBox.TextColor3 = Color3.fromRGB(255,255,255)
  583.     ExecuteEventsBox.TextTransparency = 0.1
  584.     ExecuteEventsBox.TextStrokeTransparency = 0
  585.     ExecuteEventsBox.Text = "Execute"
  586.     ExecuteEventsBox.TextScaled = false
  587.     ExecuteEventsBox.TextSize = 28
  588.     ExecuteEventsBox.Font = Enum.Font.Cartoon
  589.     ExecuteEventsBox.Position = UDim2.new(0.425,0,0.8,0)
  590.     ExecuteEventsBox.Size = UDim2.new(0.185,0,0.15,0)
  591.     ExecuteEventsBox.TextXAlignment = "Center"
  592.     ExecuteEventsBox.TextYAlignment = "Center"
  593.    
  594.     local i = 1
  595.     local Title = {Main:FindFirstChild("Title1") or Instance.new("TextLabel",Main), Main:FindFirstChild("Title2") or Instance.new("TextLabel",Main), Main:FindFirstChild("Title3") or Instance.new("TextLabel",Main), Main:FindFirstChild("Title4") or Instance.new("TextLabel",Main)}
  596.     Title[i].Name = "Title1"
  597.     Title[i].BackgroundColor3 = Color3.fromRGB(0,0,0)
  598.     Title[i].BackgroundTransparency = 1
  599.     Title[i].BorderColor3 = Color3.fromRGB(0,0,0)
  600.     Title[i].BorderSizePixel = 0
  601.     Title[i].TextColor3 = Color3.fromRGB(255,255,255)
  602.     Title[i].TextTransparency = 0.1
  603.     Title[i].TextStrokeTransparency = 0
  604.     Title[i].Text = "DestroyTimes"
  605.     Title[i].TextScaled = false
  606.     Title[i].TextSize = 28
  607.     Title[i].Font = Enum.Font.Cartoon
  608.     Title[i].Position = UDim2.new(0.715,0,0.605-0.2,0)
  609.     Title[i].Size = UDim2.new(0.185,0,0.145,0)
  610.     Title[i].TextXAlignment = "Center"
  611.     Title[i].TextYAlignment = "Center"
  612.     i = 2
  613.     Title[i].Name = "Title2"
  614.     Title[i].BackgroundColor3 = Color3.fromRGB(0,0,0)
  615.     Title[i].BackgroundTransparency = 1
  616.     Title[i].BorderColor3 = Color3.fromRGB(0,0,0)
  617.     Title[i].BorderSizePixel = 0
  618.     Title[i].TextColor3 = Color3.fromRGB(255,255,255)
  619.     Title[i].TextTransparency = 0.1
  620.     Title[i].TextStrokeTransparency = 0
  621.     Title[i].Text = "BewteenTimes"
  622.     Title[i].TextScaled = false
  623.     Title[i].TextSize = 28
  624.     Title[i].Font = Enum.Font.Cartoon
  625.     Title[i].Position = UDim2.new(0.425,0,0.605-0.2,0)
  626.     Title[i].Size = UDim2.new(0.185,0,0.145,0)
  627.     Title[i].TextXAlignment = "Center"
  628.     Title[i].TextYAlignment = "Center"
  629.     i = 3
  630.     Title[i].Name = "Title3"
  631.     Title[i].BackgroundColor3 = Color3.fromRGB(0,0,0)
  632.     Title[i].BackgroundTransparency = 1
  633.     Title[i].BorderColor3 = Color3.fromRGB(0,0,0)
  634.     Title[i].BorderSizePixel = 0
  635.     Title[i].TextColor3 = Color3.fromRGB(255,255,255)
  636.     Title[i].TextTransparency = 0.1
  637.     Title[i].TextStrokeTransparency = 0
  638.     Title[i].Text = "RepeatTimes"
  639.     Title[i].TextScaled = false
  640.     Title[i].TextSize = 28
  641.     Title[i].Font = Enum.Font.Cartoon
  642.     Title[i].Position = UDim2.new(0.135,0,0.605-0.2,0)
  643.     Title[i].Size = UDim2.new(0.185,0,0.145,0)
  644.     Title[i].TextXAlignment = "Center"
  645.     Title[i].TextYAlignment = "Center"
  646.     i = 4
  647.     Title[i].Name = "Title4"
  648.     Title[i].BackgroundColor3 = Color3.fromRGB(0,0,0)
  649.     Title[i].BackgroundTransparency = 1
  650.     Title[i].BorderColor3 = Color3.fromRGB(0,0,0)
  651.     Title[i].BorderSizePixel = 0
  652.     Title[i].TextColor3 = Color3.fromRGB(255,255,255)
  653.     Title[i].TextTransparency = 0.1
  654.     Title[i].TextStrokeTransparency = 0
  655.     Title[i].Text = "NameEvents"
  656.     Title[i].TextScaled = false
  657.     Title[i].TextSize = 30
  658.     Title[i].Font = Enum.Font.Cartoon
  659.     Title[i].Position = UDim2.new(0.405,0,0.2-0.2,0)
  660.     Title[i].Size = UDim2.new(0.215,0,0.125,0)
  661.     Title[i].TextXAlignment = "Center"
  662.     Title[i].TextYAlignment = "Center"
  663.    
  664.     local repeatvalue, bewteenvalue, destroytimes = Instance.new("NumberValue",RepeatBox), Instance.new("NumberValue",BetweenBox), Instance.new("NumberValue",DestroyTimesBox)
  665.     --search event system
  666.     local ItemFrame = Instance.new("ScrollingFrame")
  667.     ItemFrame.Name = "ItemFrame"
  668.     ItemFrame.Parent = EventsBox
  669.     ItemFrame.BackgroundColor3 = Color3.new(0.317647, 0.317647, 0.317647)
  670.     ItemFrame.BorderSizePixel = 0
  671.     ItemFrame.Position = UDim2.new(0,0,1,0)
  672.     ItemFrame.BackgroundTransparency = 1
  673.     ItemFrame.Size = UDim2.new(1,0,1,0)
  674.     ItemFrame.BottomImage = "rbxasset://textures/ui/Scroll/scroll-middle.png"
  675.     ItemFrame.CanvasSize = UDim2.new(0, 0, 0, 0)
  676.     ItemFrame.TopImage = "rbxasset://textures/ui/Scroll/scroll-middle.png"
  677.    
  678.     local path = ListEvents
  679.     local items = ItemFrame
  680.    
  681.     local function search(text)
  682.     local items = {}
  683.         for i, v in next, path:GetChildren() do
  684.             if text:upper() == v.Name:sub(1, string.len(text)):upper() then
  685.                 table.insert(items, v.Name)
  686.             end
  687.         end
  688.         return items
  689.     end
  690.     local function bind(thing, f)
  691.         thing.MouseButton1Click:connect(function()
  692.             f()
  693.         end)
  694.     end
  695.     EventsBox.Changed:connect(function()
  696.         local list = search(EventsBox.Text)
  697.         if EventsBox.Text:gsub("", "") == "" then
  698.             items.CanvasSize = UDim2.new(0, 0, 0, 0)
  699.             items:ClearAllChildren()
  700.             return
  701.         end
  702.         items.CanvasSize = UDim2.new(0, 0, 0, 0)
  703.         items:ClearAllChildren()
  704.         for i, v in next, list do
  705.             local yPos = ((20 * i) - 20)
  706.             local s = Instance.new('TextButton', items)
  707.             s.BorderSizePixel = 0
  708.             s.Font = Enum.Font.ArialBold
  709.             s.TextScaled = true
  710.             s.Text = v
  711.             s.Name = v
  712.             s.BackgroundColor3 = Color3.fromRGB(211, 211, 211)
  713.             s.TextColor3 = Color3.new(0, 0, 0)
  714.             s.Size = UDim2.new(1, 0, 0.5, 0)
  715.             s.Position = UDim2.new(0, 0, 0, yPos)
  716.             bind(s, function()
  717.                 EventsBox.Text = s.Text
  718.                 items:ClearAllChildren()
  719.                 items.CanvasSize = UDim2.new(0, 0, 0, 0)
  720.                 s:Destroy()
  721.             end)
  722.             if EventsBox.Text == s.Text then
  723.                 items.CanvasSize = UDim2.new(0, 0, 0, 0)
  724.                 items:ClearAllChildren()
  725.             end
  726.         end
  727.         items.CanvasSize = UDim2.new(0, 0, 0, (20 * #list))
  728.     end)  
  729.     --fade in  
  730.     for i = 0, 1, .025 do
  731.         Main.Visible = true
  732.         local ns = lerp(0.00125,0.5,i)
  733.         Main.Size = UDim2.new(ns+ns*0.2,0, ns+ns*0.1,0)
  734.         rs:wait()
  735.     end
  736.     --fade out
  737.     CloseButton.MouseButton1Click:connect(function()
  738.         for i = 0, 1, .025 do
  739.             local ns = lerp(0.5,0.00125,i)
  740.             Main.Size = UDim2.new(ns+ns*0.2,0, ns+ns*0.1,0)
  741.             rs:wait()
  742.         end
  743.         Main.Visible = false
  744.     end)
  745.     --make event
  746.     if actived[1] == false then
  747.         actived[1] = true
  748.         ExecuteEventsBox.MouseButton1Click:connect(function()
  749.             spawn(function()
  750.                 repeatvalue,bewteenvalue,destroytimes = RepeatBox.Text,BetweenBox.Text,DestroyTimesBox.Text
  751.                 local Fixed_Event = EventsBox.Text
  752.                 Message("Disaster : " ..Fixed_Event .." are coming!",2)
  753.                 wait(2)
  754.                 Check_Survive()
  755.                 for i = 1, repeatvalue do
  756.                     Events[Fixed_Event].Create(destroytimes)
  757.                     wait(bewteenvalue)
  758.                 end
  759.                 Reset_Survive()
  760.                 Message("Survive : " ..table.concat(Survivalist, ' '))
  761.                 spawn(function()
  762.                     for i = 1, #Survivalist do
  763.                         table.remove(Survivalist, i)
  764.                     end
  765.                 end)
  766.             end)
  767.         end)
  768.     end
  769. end
  770.  
  771. local MapChooserGui = function()
  772.     local function lerp(a,b,c)
  773.         return a+(b-a)*c  
  774.     end
  775.     local Screen = PlayerGui:FindFirstChild("MapChooser")
  776.     if Screen == nil then
  777.         Screen = Instance.new("ScreenGui",PlayerGui)
  778.         actived[2] = false
  779.     end
  780.     Screen.Name = "MapChooser"
  781.     local Frame = Screen:FindFirstChild("Main") or Instance.new("Frame",Screen)
  782.     Frame.Visible = true
  783.     Frame.Name = "Main"
  784.     Frame.Size = UDim2.new(0.5,0,0.325,0)
  785.     Frame.BackgroundColor3 = Color3.fromRGB(175,175,175)
  786.     Frame.BorderSizePixel = 3
  787.     Frame.BorderColor3 = Color3.fromRGB(255,255,255)
  788.     Frame.BackgroundTransparency = 1
  789.     Frame.Active = true
  790.     Frame.Selectable = false
  791.     Frame.Draggable = true
  792.     local ExecuteBox = Frame:FindFirstChild("Execute") or Instance.new("TextButton",Frame)
  793.     ExecuteBox.Name = "Execute"
  794.     ExecuteBox.Style = Enum.ButtonStyle.Custom
  795.     ExecuteBox.Size = UDim2.new(0.25,0,0.205,0)
  796.     ExecuteBox.Position = UDim2.new(0.4,0,0.75,0)
  797.     ExecuteBox.BorderSizePixel = 0
  798.     ExecuteBox.BackgroundColor3 = Color3.fromRGB(0,170,255)
  799.     ExecuteBox.TextColor3 = Color3.fromRGB(255,255,255)
  800.     ExecuteBox.Text = "Execute"
  801.     ExecuteBox.TextSize = 20
  802.     local Input = Frame:FindFirstChild("Input") or Instance.new("TextBox",Frame)
  803.     Input.Name = "Input"
  804.     Input.Text = ""
  805.     Input.Size = ExecuteBox.Size + UDim2.new(0.2,0,0.1,0)
  806.     Input.Position = ExecuteBox.Position + UDim2.new(-0.1,0,-0.425,0)
  807.     Input.BorderSizePixel = 0
  808.     Input.BackgroundColor3 = Color3.fromRGB(0,0,0)
  809.     Input.BackgroundTransparency = 0.6
  810.     Input.TextColor3 = Color3.fromRGB(255,255,255)
  811.     Input.TextSize = 26
  812.     Input.ShowNativeInput = true
  813.     Input.ClearTextOnFocus = false
  814.     Input.PlaceholderText = "MapName or ID"
  815.     local CloseButton = Frame:FindFirstChild("Close") or Instance.new("TextButton",Frame)
  816.     CloseButton.Name = "Close"
  817.     CloseButton.Size = UDim2.new(0.05,0,0.125,0)
  818.     CloseButton.Position = UDim2.new(0.95,0,0,0)
  819.     CloseButton.BackgroundColor3 = Color3.fromRGB(255,0,0)
  820.     CloseButton.BackgroundTransparency = 0.3
  821.     CloseButton.Text = "X"
  822.     CloseButton.TextScaled = true
  823.     for i = 0 ,1 ,0.0625 do
  824.         local cn = lerp(1,0.5,i)
  825.         Frame.BackgroundTransparency = cn
  826.         ExecuteBox.BackgroundTransparency = cn
  827.         ExecuteBox.TextTransparency = cn-cn*0.9
  828.         Input.BackgroundTransparency = cn
  829.         Input.TextTransparency = cn-cn*0.9
  830.         rs:wait()
  831.     end
  832.     if actived[2] == false then
  833.         actived[2] = true
  834.         ExecuteBox.MouseButton1Click:connect(function()
  835.             if debouce_execute[1] == false then
  836.                 debouce_execute[1] = true
  837.                 local ID = Input.Text
  838.                 Map[ID].Create()
  839.             end
  840.         end)
  841.     end
  842.     CloseButton.MouseButton1Click:connect(function()
  843.         for i = 0 ,1 ,0.0625 do
  844.             local cn = lerp(0.5,1,i)
  845.             Frame.BackgroundTransparency = cn
  846.             ExecuteBox.BackgroundTransparency = cn
  847.             ExecuteBox.TextTransparency = cn
  848.             Input.BackgroundTransparency = cn
  849.             Input.TextTransparency = cn
  850.             rs:wait()
  851.         end
  852.         Frame.Visible = false
  853.     end)
  854.     --Nothing
  855. end
  856.  
  857. --  End_Gui_System  --
  858.  
  859. ------------------------------------------------------------------------------------------------------------------------------------------------
  860.  
  861. -- Check_Map-Placed Function
  862.  
  863. ------------------------------------------------------------------------------------------------------------------------------------------------
  864.  
  865. function float(parent)
  866. local part = parent:GetChildren()
  867. for i=1, #part do
  868. part[i].Velocity = Vector3.new(0,0,0)
  869. part[i].RotVelocity = Vector3.new(0,0,0)
  870. end
  871. end
  872.  
  873. function anchored(parent)
  874. local part = parent:GetChildren()
  875. for i=1, #part do
  876. part[i].Anchored = true
  877. part[i].Velocity = Vector3.new(0,0,0)
  878. part[i].RotVelocity = Vector3.new(0,0,0)
  879. end
  880. end
  881.  
  882. function uncomfirm(parent)
  883. local part = parent:GetChildren()
  884. for i=1, #part do
  885. part[i].Transparency = 0.65
  886. end
  887. end
  888.  
  889. function comfirm(parent)
  890. local part = parent:GetChildren()
  891. for i=1, #part do
  892. part[i].CanCollide = true
  893. end
  894. end
  895.  
  896. function checkconfirm(Map)
  897.     spawn(function()
  898.         local Click = false
  899.         while Click == false do
  900.         float(Map)
  901.         Mouse.Move:connect(function()
  902.             if Click == false then
  903.                 Map:MoveTo(Vector3.new(Mouse.Hit.X,Mouse.Target.Position.Y,Mouse.Hit.Z))
  904.             end
  905.         end)
  906.         Mouse.Button1Up:connect(function()
  907.             if Click == false then
  908.                 anchored(Map)
  909.                 comfirm(Map)
  910.                 Click = true
  911.             end
  912.         end)
  913.         if Click == true then
  914.             break
  915.         end
  916.        
  917.         Mouse.KeyDown:connect(function(key)
  918.             if key == 'm' and Click == false then
  919.                 Map:Destroy()
  920.                 Click = true
  921.             end
  922.         end)
  923.         wait()
  924.         end
  925.     end)
  926. end
  927.  
  928. function resetmap()
  929.     CoreEvents.Parent:Destroy()
  930. end
  931.  
  932. ------------------------------------------------------------------------------------------------------------------------------------------------
  933.  
  934. -- Object & E-Object
  935.  
  936. ------------------------------------------------------------------------------------------------------------------------------------------------
  937.  
  938. local multiplier = 1
  939.  
  940. function hurt(hit, dmg, notdamgewith)
  941.     if hit.Parent then
  942.         if hit.Parent.Name == "box" then print("bocks!11") hit.Parent:Destroy() end
  943.         local hum = hit.Parent:FindFirstChildOfClass("Humanoid")
  944.         if hum then
  945.             if hum.Parent.Name ~= notdamgewith then
  946.                 if dmg == "Kill" or hum.Health > 100000 then
  947.                     hit.Parent:BreakJoints()
  948.                     return true
  949.                 else
  950.                     if math.random(0, 100) == 50 then
  951.                         hum.Health = hum.Health - dmg*multiplier*2.5
  952.                     else
  953.                         hum.Health = hum.Health -dmg*multiplier
  954.                     end
  955.                     return true
  956.                 end
  957.             end
  958.         end
  959.     end
  960. end
  961.  
  962. local ObjFolder = Instance.new("Folder",workspace)
  963. ObjFolder.Name = "ObjectEvent"
  964.    
  965. ClearObjEvent = function()
  966.     ObjFolder:ClearAllChildren()
  967. end
  968.  
  969. Events = {
  970.     ["blackhole"] = {
  971.         Create = function()
  972.             local BlackHoleObj = new(ObjFolder,0,0,false,true,Color3.fromRGB(0,0,0),"BlackHole",Vector3.new(math.random(20,25),math.random(20,25),math.random(20,25)),"")
  973.             BlackHoleObj.Shape = Enum.PartType.Ball        
  974.             BlackHoleObj.Material = Enum.Material.Neon
  975.             BlackHoleObj.Position = CoreEvents.Position + Vector3.new(0,math.random(25,50),0)
  976.             BlackHoleObj.Anchored = true
  977.            
  978.             coroutine.resume(coroutine.create(function()
  979.                 local hole = BlackHoleObj
  980.                 local childList = {}
  981.                
  982.                 local massConstant = 5.8 -- Generally a good value
  983.                
  984.                 local mass = math.random(16000,20000) * massConstant
  985.                
  986.                 -- This is basically a function that finds all unanchored parts and adds them to childList.
  987.                 -- Note: This should only be run once for each object
  988.                 function checkObject(obj)
  989.                     if (obj ~= hole) and (obj.className == "Part") then
  990.                         if (obj.Anchored == false) then
  991.                             table.insert(childList, 1, obj)
  992.                         end
  993.                     elseif (obj.className == "Model") or (obj.className == "Hat") or (obj.className == "Tool") or (obj == workspace) then
  994.                         local child = obj:GetChildren()
  995.                         for x = 1, #child do
  996.                             checkObject(child[x])
  997.                         end
  998.                         obj.ChildAdded:connect(checkObject)
  999.                     end
  1000.                 end
  1001.                
  1002.                 checkObject(workspace)            
  1003.                 local n = 0
  1004.                 while wait() do
  1005.                     checkObject(workspace)
  1006.                     if n < #childList then
  1007.                         n = n + 1
  1008.                         if n % 800 == 0 then
  1009.                             wait()
  1010.                         end
  1011.                     else
  1012.                         n = 1
  1013.                         wait()
  1014.                     end
  1015.                
  1016.                     local child = childList[n]
  1017.                     if (child ~= hole) and (child.className == "Part") and (child.Anchored == false) then
  1018.                         local relPos = hole.Position - child.Position
  1019.                         local motivator = child:FindFirstChild("BlackHole Influence")
  1020.                     --Entered Horizon Event
  1021.                     if relPos.magnitude * 160 * massConstant < mass then
  1022.                     --child:BreakJoints()
  1023.                         if (relPos.magnitude * 320 * massConstant < mass) and (child.Size.z + hole.Size.x >  relPos.magnitude * 2 - 4) then
  1024.                             mass = mass + child:GetMass()
  1025.                             child:Remove()
  1026.                             table.remove(childList, n)
  1027.                             n = n - 1 -- This is the reason I need a counter of my own design
  1028.                         else
  1029.                             child.CanCollide = false -- I Can assume that things won't escape the black hole.
  1030.                             if motivator == nil then
  1031.                                 motivator = Instance.new("BodyPosition")
  1032.                                 motivator.Parent = child
  1033.                                 motivator.Name = "BlackHole Influence"
  1034.                             end
  1035.                                 motivator.position = hole.Position
  1036.                                 motivator.maxForce = Vector3.new(1, 1, 1) * mass * child:GetMass() / (relPos.magnitude * massConstant)
  1037.                             end
  1038.                         elseif motivator ~= nil then
  1039.                             motivator:Remove()
  1040.                     end
  1041.                    
  1042.                     end
  1043.                 end
  1044.             end))
  1045.         end
  1046.     };
  1047.    
  1048.     ["avalanche"] = {
  1049.         Create = function(timedisappears)
  1050.             local pos = CoreEvents.Position    
  1051.            
  1052.             local wedge1 = Instance.new("WedgePart",ObjFolder)
  1053.             wedge1.Anchored = true
  1054.             wedge1.Size = Vector3.new(197,20,50)
  1055.             wedge1.Material = Enum.Material.Sand
  1056.             wedge1.Color = Color3.fromRGB(255,255,255)
  1057.             wedge1.Position = Vector3.new(pos.X,pos.Y,pos.Z+73)
  1058.            
  1059.             local coversnow = new(ObjFolder,0,0,true,false,Color3.fromRGB(255,255,255),"SnowCovered",Vector3.new(250,5,200),"")
  1060.             coversnow.Material = Enum.Material.Sand
  1061.             coversnow.CFrame = CoreEvents.CFrame
  1062.             wait(2)
  1063.             for i = 1, math.random(40,60) do
  1064.                 local GiantSnowBall = new(ObjFolder,0,0,false,true,Color3.fromRGB(255,255,255),"SnowBall",Vector3.new(math.random(10,17),math.random(10,17),math.random(10,17)),"")
  1065.                 GiantSnowBall.Material = Enum.Material.Sand
  1066.                 GiantSnowBall.Shape = Enum.PartType.Ball
  1067.                 GiantSnowBall.Position = wedge1.Position + Vector3.new(math.random(-100,100),math.random(30,120),math.random(-10,10))
  1068.                 GiantSnowBall.Touched:connect(function(hit)
  1069.                     hurt(hit, 100, "")
  1070.                 end)
  1071.             end
  1072.             wait(timedisappears)
  1073.             ClearObjEvent()
  1074.         end
  1075.     };
  1076.    
  1077.     ["heavysnow"] = {
  1078.         Create = function()
  1079.             local touched = false
  1080.             local randomsize = Vector3.new(math.random(1.2,5.2),math.random(1.2,5.2),math.random(1.2,5.2))
  1081.             local Snow = new(ObjFolder,0,0,false,true,Color3.fromRGB(255,255,255),"Snow",randomsize,"")
  1082.             Snow.Shape = Enum.PartType.Ball
  1083.             Snow.Material = Enum.Material.Sand
  1084.             Snow.Position = Vector3.new(CoreEvents.Position.X+math.random(-80,80),CoreEvents.Position.Y+math.random(100,120),CoreEvents.Position.Z+math.random(-80,80))
  1085.             Snow.Velocity = Vector3.new(math.random(-120,120),math.random(-25,50),math.random(-120,120))
  1086.            
  1087.             Snow.Touched:connect(function(hit)
  1088.                 hurt(hit ,math.random(5,10), "")
  1089.                 spawn(function()
  1090.                     if touched == false then
  1091.                         touched = true
  1092.                         wait(math.random(1,3))
  1093.                         local SnowThaw = new(ObjFolder,0,0,false,false,Color3.fromRGB(255,255,255),"ThawSnow",randomsize,"")
  1094.                         SnowThaw.Material = Enum.Material.Sand
  1095.                         SnowThaw.Position = Snow.Position
  1096.                         Snow:Destroy()
  1097.                         return
  1098.                     end
  1099.                 end)
  1100.             end)
  1101.         end
  1102.     };
  1103.    
  1104.     ["meteor"] = {
  1105.         Create = function()
  1106.                 local huge = Vector3.new(math.huge,math.huge,math.huge)
  1107.                
  1108.                 local p = new(ObjFolder,0,0,false,true,Color3.fromRGB(75,75,75),"Meteor",Vector3.new(math.random(4,10),math.random(3,7),math.random(4,10)),"")
  1109.                     p.Size = Vector3.new(math.random(4,10),math.random(3,7),math.random(4,10))
  1110.                     p.Shape = "Ball"
  1111.                     p.Material = Enum.Material.Neon
  1112.                     p.Position = Vector3.new(CoreEvents.Position.X+math.random(-80,80),CoreEvents.Position.Y+math.random(125,175),CoreEvents.Position.Z+math.random(-80,80))
  1113.                    
  1114.                 local pe = Instance.new("ParticleEmitter", p)
  1115.                     pe.Color = ColorSequence.new(BrickColor.new("Bright red").Color)
  1116.                     pe.LightEmission = 0.7
  1117.                     pe.Size = NumberSequence.new(20)
  1118.                     pe.Texture = "rbxassetid://243664672"
  1119.                     pe.Transparency = NumberSequence.new(0.4)
  1120.                     pe.Lifetime = NumberRange.new(0.2)
  1121.                     pe.Rate = 500
  1122.                     pe.Speed = NumberRange.new(3)  
  1123.                
  1124.                 local bv = Instance.new("BodyVelocity", p)
  1125.                     bv.MaxForce = huge
  1126.                     bv.Velocity = Vector3.new(math.random(-160,160),math.random(-425,-250),math.random(-160,160))
  1127.                    
  1128.                     p.Touched:connect(function(hit)
  1129.                         spawn(function()
  1130.                             CameraEnshaking(5,10,'all')
  1131.                             local s = Sound(idSounds[3],"Crushed",0.25,false,ObjFolder,true,math.random(1.2,2),true)
  1132.                         end)
  1133.                        
  1134.                         local ep = Instance.new("Explosion")
  1135.                         ep.BlastRadius = math.random(15,30)
  1136.                         ep.BlastPressure = 27
  1137.                         ep.Position =  p.Position
  1138.                         ep.Parent = ObjFolder
  1139.                        
  1140.                         if hit.Name ~= "Meteor" then
  1141.                             hurt(hit, math.random(30,60), "")
  1142.                         end
  1143.                        
  1144.                         for i = 1, math.random(5,12) do
  1145.                             local samei = math.random(15,95)
  1146.                             local effect = new(ObjFolder,0,0,false,true,Color3.fromRGB(samei,samei,samei),"Rocks",Vector3.new(math.random(0.5,2),math.random(1,2),math.random(0.5,2.1)),"")
  1147.                             effect.Position = p.Position
  1148.                            
  1149.                             effect.Velocity = Vector3.new(math.random(-160,160),math.random(1,75),math.random(-160,160))
  1150.                                
  1151.                             effect.Touched:connect(function(hit)
  1152.                                 hurt(hit, math.random(5,20), "")
  1153.                             end)
  1154.                             spawn(function()
  1155.                                 wait(math.random(5,10))
  1156.                                 effect:Destroy()
  1157.                             end)
  1158.                         end
  1159.                        
  1160.                         bv:Destroy()
  1161.                         p:Destroy()
  1162.                     end)
  1163.                    
  1164.                 local meshMeteor = mesh("SpecialMesh",p,"FileMesh","http://www.roblox.com/asset/?id=1290033",Vector3.new(0,0,0),Vector3.new(math.random(5,7),math.random(4,7),math.random(5,7)))
  1165.                
  1166.                 nooutline(p)
  1167.             end
  1168.     };
  1169.        
  1170.     ["flood"] = {
  1171.         Create = function(timedestroy)
  1172.             local huge = Vector3.new(math.huge,math.huge,math.huge)
  1173.                
  1174.             local FloodPart = new(ObjFolder,0,0,false,false,Color3.fromRGB(9,137,207),"Flood",Vector3.new(250,1,200),"")
  1175.                 FloodPart.Material = "Sand"
  1176.                 FloodPart.Position = Vector3.new(CoreEvents.Position.X,CoreEvents.Position.Y,CoreEvents.Position.Z)
  1177.             FloodPart.Touched:connect(function(hit)
  1178.                 hurt(hit, math.random(60,100), "")
  1179.             end)
  1180.             local bv = Instance.new("BodyVelocity", FloodPart)
  1181.                 bv.MaxForce = huge
  1182.                 bv.Velocity = Vector3.new(0,2,0)
  1183.                
  1184.             local AnimeWater = Instance.new("Texture",FloodPart)
  1185.                 AnimeWater.Texture = "rbxasset://textures/water/normal_21.dds"
  1186.                 AnimeWater.Transparency = 0.2
  1187.                 AnimeWater.StudsPerTileU = 10
  1188.                 AnimeWater.StudsPerTileV = 10
  1189.                 AnimeWater.Face = "Top"
  1190.                 AnimeWater.Name = "WaterTexture"
  1191.                 AnimeWater.Color3 = Color3.fromRGB(0,85,255)
  1192.                
  1193.             spawn(function()
  1194.                 while true do
  1195.                     for i = 1,25 do
  1196.                         for _,v in pairs(FloodPart:GetChildren()) do
  1197.                             if v:IsA("Texture") then
  1198.                                 v.Texture = string.format("rbxasset://textures/water/normal_%02d.dds",i)
  1199.                             end
  1200.                         end
  1201.                         wait()
  1202.                     end
  1203.                 end
  1204.             end)  
  1205.                
  1206.             spawn(function()
  1207.                 wait(timedestroy)
  1208.                 bv:Destroy()
  1209.                 FloodPart:Destroy()
  1210.             end)
  1211.         end
  1212.     };
  1213.        
  1214.     ["killer"] = {
  1215.         Create = function()
  1216.             --Create BotKiller
  1217.             local bot = Instance.new("Model",ObjFolder)
  1218.             local rarmbot = new(bot,0,0,false,false,Color3.fromRGB(255,255,255),"Right Arm",Vector3.new(1,2,1),"Torso")
  1219.             local larmbot = new(bot,0,0,false,false,Color3.fromRGB(255,255,255),"Left Arm",Vector3.new(1,2,1),"Torso")
  1220.             local rlegbot = new(bot,0,0,false,false,Color3.fromRGB(255,255,255),"Right Leg",Vector3.new(1,2,1),"Torso")
  1221.             local llegbot = new(bot,0,0,false,false,Color3.fromRGB(255,255,255),"Left Leg",Vector3.new(1,2,1),"Torso")
  1222.             local torsobot = new(bot,0,0,false,true,Color3.fromRGB(255,255,255),"Torso",Vector3.new(2,2,1),"Torso")
  1223.             local headbot = new(bot,0,0,false,false,Color3.fromRGB(255,255,255),"Head",Vector3.new(2,1,1),"Torso")
  1224.             local humanoidbot = Instance.new("Humanoid",bot)
  1225.             humanoidbot.MaxHealth = math.huge
  1226.             humanoidbot.Health = math.huge
  1227.             humanoidbot.WalkSpeed = math.random(24,38)
  1228.            
  1229.             bot.Name = "Killer"
  1230.            
  1231.             local weldrarmbot = weld(rarmbot,rarmbot,torsobot,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(1.5, 0, 0))
  1232.             local weldlarmbot = weld(larmbot,larmbot,torsobot,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(-1.5, 0, 0))
  1233.             local weldrlegbot = weld(rlegbot,rlegbot,torsobot,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(0.5, 2, 0))
  1234.             local weldllegbot = weld(llegbot,llegbot,torsobot,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(-0.5, 2, 0))
  1235.             local weldtorsobot = weld(torsobot,torsobot,torsobot,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(0, 0, 0))
  1236.             local weldheadbot = weld(headbot,headbot,torsobot,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(0, -1.5, 0))
  1237.            
  1238.             local meshheadbot = Instance.new("SpecialMesh",headbot)
  1239.             meshheadbot.Offset = Vector3.new(0,0,0)
  1240.             meshheadbot.VertexColor = Vector3.new(1,1,1)
  1241.             meshheadbot.Scale = Vector3.new(1.25,1.25,1.25)
  1242.            
  1243.             bot:MoveTo(Vector3.new(CoreEvents.Position.X+math.random(-50,50),CoreEvents.Position.Y+4,CoreEvents.Position.Z+math.random(-50,50)))  
  1244.            
  1245.             --Damage BotKiller
  1246.             headbot.Touched:connect(function(hit)
  1247.                 hurt(hit, math.random(2,8), "Killer")
  1248.             end)
  1249.            
  1250.             --Follow Function
  1251.             --local ftorsobot = torsobot
  1252.             --local h = humanoidbot
  1253.             local spawnCF = torsobot.CFrame
  1254.            
  1255.             spawn(function()
  1256.                 local findNearestTorso = function(pos)
  1257.                     local list = game.Workspace:children()
  1258.                     local torso = nil
  1259.                     local dist = 100
  1260.                     local temp = nil
  1261.                     local human = nil
  1262.                     local temp2 = nil
  1263.                     for x =1, #list do
  1264.                         temp2 = list[x]
  1265.                         if (temp2.className == "Model") and (temp2 ~= humanoidbot.Parent) then
  1266.                             temp = temp2:findFirstChild("Torso")
  1267.                             human = temp2:findFirstChild("Humanoid")
  1268.                             if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then
  1269.                                 if (temp.Position - pos).magnitude < dist then
  1270.                                     torso = temp
  1271.                                     dist = (temp.Position - pos).magnitude
  1272.                                 end
  1273.                             end
  1274.                         end
  1275.                     end
  1276.                     return torso
  1277.                 end
  1278.                
  1279.             while wait() do
  1280.                 local target = findNearestTorso(torsobot.Position)
  1281.                 if target ~= nil then
  1282.                     humanoidbot:MoveTo(target.Position, target)
  1283.                 end
  1284.             end
  1285.            
  1286.             end)
  1287.         end
  1288.     };
  1289.    
  1290.     ["acid_rains"] = {
  1291.         Create = function()
  1292.             local acidrainparts = new(ObjFolder,0,0,false,false,Color3.fromRGB(0,math.random(200,255),0),"Rains",Vector3.new(math.random(0.5,0.6),math.random(2.5,3.5),math.random(0.5,0.6)),"")
  1293.             local sameacidscolor = acidrainparts.Color    
  1294.             acidrainparts.Position = CoreEvents.Position + Vector3.new(math.random(-80,80),math.random(125,175),math.random(-80,80))
  1295.             acidrainparts.Touched:connect(function(hit)
  1296.                 if hit ~= CoreEvents then
  1297.                     hit.Color = sameacidscolor
  1298.                 end
  1299.                 hurt(hit, math.random(5,20), "")
  1300.                 hit:BreakJoints()
  1301.                 acidrainparts:Destroy()
  1302.             end)      
  1303.             nooutline(acidrainparts)
  1304.         end
  1305.     };
  1306.    
  1307.     ["nuke"] = {
  1308.         Create = function()
  1309.             local debouncetouched = false
  1310.             local size = Vector3.new(2,4,2)
  1311.             local nuke = new(ObjFolder,0,0,false,false,Color3.fromRGB(0,math.random(200,255),0),"Nuke",size,"")
  1312.             nuke.Position = CoreEvents.Position + Vector3.new(math.random(-40,40),100,math.random(-40,40))
  1313.             local function lerp(a,b,c)
  1314.                 return a+(b-a)*c  
  1315.             end
  1316.             nuke.Touched:connect(function(hit)
  1317.                 if debouncetouched ~= true then
  1318.                     debouncetouched = true
  1319.                     Sound(idSounds[3],"BOOM!!!",5,false,nuke,true,1,true)
  1320.                     CameraEnshaking(3,5,'')
  1321.                     local radioactive = new(ObjFolder,0,0,true,false,Color3.fromRGB(0,math.random(200,255),0),"RadioActive",Vector3.new(1,1,1),"")
  1322.                     radioactive.Shape = Enum.PartType.Cylinder
  1323.                     radioactive.Material = Enum.Material.Neon
  1324.                     radioactive.Orientation = Vector3.new(0,0,90)
  1325.                     radioactive.Position = nuke.Position
  1326.                     radioactive.Position = Vector3.new(radioactive.Position.X,CoreEvents.Position.Y+1,radioactive.Position.Z)
  1327.                     radioactive.Touched:connect(function(hit)
  1328.                         hurt(hit,50,'')
  1329.                     end)
  1330.                     spawn(function()
  1331.                         while wait(0.2) do
  1332.                             spawn(function()
  1333.                                 local function lerp(a,b,c)
  1334.                                     return a+(b-a)*c  
  1335.                                 end
  1336.                                 local function rndRange(rng)
  1337.                                     return math.random(-rng*1000,rng*1000)/1000
  1338.                                 end
  1339.                                 local magik = Instance.new("Part", ObjFolder)
  1340.                                 magik.Anchored = true
  1341.                                 magik.Locked = true
  1342.                                 magik.Material = "Neon"
  1343.                                 magik.FormFactor = "Custom"
  1344.                                 magik.Size = Vector3.new(1.2, 1.2, 1.2)
  1345.                                 magik.TopSurface = "Smooth"
  1346.                                 magik.BottomSurface = "Smooth"
  1347.                                 magik.Transparency = 0
  1348.                                 magik.CanCollide = false
  1349.                                        
  1350.                                 magik.BrickColor = BrickColor.new(0,math.random(200,255),0)
  1351.                                
  1352.                                 magik.Touched:connect(function(hit)
  1353.                                     hurt(hit,5,'')
  1354.                                 end)
  1355.                                 local mr = math.rad
  1356.                                 local rnx,rny,rnz = mr(rndRange(20)),mr(rndRange(20)),mr(rndRange(200))
  1357.                                 local cf = radioactive.CFrame * CFrame.new(math.random(-radioactive.Size.x,radioactive.Size.x), 1, math.random(-radioactive.Size.z,radioactive.Size.z)) * CFrame.Angles(rnx,rny,rnz)
  1358.                                 magik.CFrame = cf
  1359.                                 for i = 0, 1, .025 do
  1360.                                     local newTrans = lerp(0.5, 1, i)
  1361.                                     local ns = lerp(1,1.2,i)
  1362.                                     magik.Transparency = newTrans
  1363.                                     magik.Size = Vector3.new(ns,ns+math.random(5,7),ns)
  1364.                                     magik.CFrame = cf
  1365.                                     rs:wait()
  1366.                                 end
  1367.                                 magik:Destroy()
  1368.                             end)
  1369.                         end
  1370.                     end)
  1371.                     coroutine.resume(coroutine.create(function()
  1372.                         for i = 0, 1, 0.005 do
  1373.                             local ns = lerp(0.5,0.05,i)
  1374.                             radioactive.Size = radioactive.Size + Vector3.new(0,ns,ns)
  1375.                             rs:wait()
  1376.                             if i <= 0.5 then
  1377.                                 coroutine.resume(coroutine.create(function()
  1378.                                     for i = 0, 1, 0.0025 do
  1379.                                         local ns = lerp(0,1,i)
  1380.                                         radioactive.Transparency = ns
  1381.                                         rs:wait()
  1382.                                     end
  1383.                                     radioactive:Destroy()
  1384.                                 end))
  1385.                             end
  1386.                         end
  1387.                        
  1388.                     end))
  1389.                     coroutine.resume(coroutine.create(function()
  1390.                         for i = 1 ,math.random(3,7) do
  1391.                             local ep = Instance.new("Explosion",ObjFolder)
  1392.                             ep.Position = nuke.Position + Vector3.new(math.random(-10,10),math.random(5,10),math.random(-10,10))
  1393.                         end
  1394.                     end))
  1395.                 end
  1396.             end)
  1397.         end
  1398.     };
  1399.    
  1400.     ["acid_raise"] = {
  1401.         Create = function()
  1402.            
  1403.         end
  1404.     };
  1405. }
  1406.  
  1407.  
  1408.  
  1409. ------------------------------------------------------------------------------------------------------------------------------------------------
  1410.  
  1411. -- Map Event
  1412.  
  1413. ------------------------------------------------------------------------------------------------------------------------------------------------
  1414.  
  1415. local Black = Color3.fromRGB(0,0,0)
  1416. local White = Color3.fromRGB(255,255,255)  
  1417.    
  1418. Map = {
  1419.     ["Basic"] = {
  1420.         Create = function()
  1421.             local debounce = false
  1422.             Mouse.Button1Up:connect(function()
  1423.                 if debounce == true then
  1424.                     return
  1425.                 end
  1426.                 local MapGroup = Instance.new("Model",workspace)
  1427.                 MapGroup.Name = "Map"
  1428.                 --Struction
  1429.                 local Core = new(MapGroup,0,0,false,true,White,"Core",Vector3.new(250,1,200),"Torso")
  1430.                 CoreEvents = Core  
  1431.                
  1432.                 local Part1 = new(MapGroup,0,0,false,false,Black,"Part",Vector3.new(2,75,2),"")
  1433.                 local Part2 = new(MapGroup,0,0,false,false,Black,"Part",Vector3.new(2,75,2),"")
  1434.                 local Part3 = new(MapGroup,0,0,false,false,Black,"Part",Vector3.new(2,75,2),"")
  1435.                 local Part4 = new(MapGroup,0,0,false,false,Black,"Part",Vector3.new(2,75,2),"")
  1436.                
  1437.                 local Part5 = new(MapGroup,0,0,false,false,Black,"Part",Vector3.new(250,2,2),"")
  1438.                 local Part6 = new(MapGroup,0,0,false,false,Black,"Part",Vector3.new(250,2,2),"")
  1439.                 local Part7 = new(MapGroup,0,0,false,false,Black,"Part",Vector3.new(2,2,200),"")
  1440.                 local Part8 = new(MapGroup,0,0,false,false,Black,"Part",Vector3.new(2,2,200),"")
  1441.                
  1442.                 local Part9 = new(MapGroup,0,0.75,false,false,Color3.fromRGB(0,0,155),"Glass",Vector3.new(246,75,0.5),"")
  1443.                 local Part10 = new(MapGroup,0,0.75,false,false,Color3.fromRGB(0,0,155),"Glass",Vector3.new(246,75,0.5),"")
  1444.                 local Part11 = new(MapGroup,0,0.75,false,false,Color3.fromRGB(0,0,155),"Glass",Vector3.new(0.5,75,198),"")
  1445.                 local Part12 = new(MapGroup,0,0.75,false,false,Color3.fromRGB(0,0,155),"Glass",Vector3.new(0.5,75,198),"")
  1446.                
  1447.                 local Weld1 = weld(Part1,Part1,Core,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(124,-38,99))
  1448.                 local Weld2 = weld(Part2,Part2,Core,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(124,-38,-99))
  1449.                 local Weld3 = weld(Part3,Part3,Core,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(-124,-38,99))
  1450.                 local Weld4 = weld(Part4,Part4,Core,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(-124,-38,-99))
  1451.                
  1452.                 local Weld5 = weld(Part5,Part5,Core,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(0,-76.5,99))
  1453.                 local Weld6 = weld(Part6,Part6,Core,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(0,-76.5,-99))
  1454.                 local Weld7 = weld(Part7,Part7,Core,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(99,-76.5,0))
  1455.                 local Weld8 = weld(Part8,Part8,Core,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(-99,-76.5,0))
  1456.                
  1457.                 local Weld9 = weld(Part9,Part9,Core,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(0,-38,99))
  1458.                 local Weld10 = weld(Part10,Part10,Core,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(0,-38,-99))
  1459.                 local Weld11 = weld(Part11,Part11,Core,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(99,-38,0))
  1460.                 local Weld12 = weld(Part12,Part12,Core,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(-99,-38,0))
  1461.                 --Decoration
  1462.                 local PartB1 = new(MapGroup,0,0,false,false,Black,"Part",Vector3.new(1,5,1),"")
  1463.                 local PartB2 = new(MapGroup,0,0,false,false,White,"Part",Vector3.new(1,5,1),"")
  1464.                 local PartB3 = new(MapGroup,0,0,false,false,Black,"Part",Vector3.new(11,1,11),"")
  1465.                 local PartB4 = new(MapGroup,0,0,false,false,White,"Part",Vector3.new(1,5,1),"")
  1466.                 local PartB5 = new(MapGroup,0,0,false,false,Black,"Part",Vector3.new(1,5,1),"")
  1467.                 local PartB6 = new(MapGroup,0,0,false,false,White,"Part",Vector3.new(1,5,1),"")
  1468.                 local PartB7 = new(MapGroup,0,0,false,false,Black,"Part",Vector3.new(1,5,1),"")
  1469.                 local PartB8 = new(MapGroup,0,0,false,false,Black,"Part",Vector3.new(1,5,1),"")
  1470.                 local PartB9 = new(MapGroup,0,0,false,false,White,"Part",Vector3.new(1,5,1),"")
  1471.                
  1472.                 local WeldB1 = weld(PartB1,PartB1,Core,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(50,-3,0))
  1473.                 local WeldB2 = weld(PartB2,PartB2,Core,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(50,-8,0))
  1474.                 local WeldB3 = weld(PartB3,PartB3,Core,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(55,-11,5))
  1475.                 local WeldB4 = weld(PartB4,PartB4,Core,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(60,-3,0))
  1476.                 local WeldB5 = weld(PartB5,PartB5,Core,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(60,-8,0))
  1477.                 local WeldB6 = weld(PartB6,PartB6,Core,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(50,-3,10))
  1478.                 local WeldB7 = weld(PartB7,PartB7,Core,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(50,-8,10))
  1479.                 local WeldB8 = weld(PartB8,PartB8,Core,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(60,-3,10))
  1480.                 local WeldB9 = weld(PartB9,PartB9,Core,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(60,-8,10))
  1481.                
  1482.                 local PartB10 = new(MapGroup,0,0,false,false,White,"Part",Vector3.new(1,5,1),"")
  1483.                 local PartB11 = new(MapGroup,0,0,false,false,Black,"Part",Vector3.new(1,5,1),"")
  1484.                 local PartB12 = new(MapGroup,0,0,false,false,Black,"Part",Vector3.new(11,1,11),"")
  1485.                 local PartB13 = new(MapGroup,0,0,false,false,White,"Part",Vector3.new(1,5,1),"")
  1486.                 local PartB14 = new(MapGroup,0,0,false,false,Black,"Part",Vector3.new(1,5,1),"")
  1487.                 local PartB15 = new(MapGroup,0,0,false,false,Black,"Part",Vector3.new(1,5,1),"")
  1488.                 local PartB16 = new(MapGroup,0,0,false,false,White,"Part",Vector3.new(1,5,1),"")
  1489.                 local PartB17 = new(MapGroup,0,0,false,false,White,"Part",Vector3.new(1,5,1),"")
  1490.                 local PartB18 = new(MapGroup,0,0,false,false,Black,"Part",Vector3.new(1,5,1),"")
  1491.                
  1492.                 local WeldB10 = weld(PartB10,PartB10,Core,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(50,-3,-10))
  1493.                 local WeldB11 = weld(PartB11,PartB11,Core,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(50,-8,-10))
  1494.                 local WeldB12 = weld(PartB12,PartB12,Core,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(55,-11,-5))
  1495.                 local WeldB13 = weld(PartB13,PartB13,Core,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(60,-14,0))
  1496.                 local WeldB14 = weld(PartB14,PartB14,Core,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(60,-19,0))
  1497.                 local WeldB15 = weld(PartB15,PartB15,Core,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(60,-3,-10))
  1498.                 local WeldB16 = weld(PartB16,PartB16,Core,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(60,-8,-10))
  1499.                 local WeldB17 = weld(PartB17,PartB17,Core,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(50,-14,10))
  1500.                 local WeldB18 = weld(PartB18,PartB18,Core,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(50,-19,10))
  1501.                
  1502.                 --Stairs
  1503.                 spawn(function()
  1504.                     local colorswap = Black
  1505.                     local change = 0
  1506.                     for i = 1 , 10 do
  1507.                         local PartStair = new(MapGroup,0,0,false,false,colorswap,"Part",Vector3.new(1,1,5),"")
  1508.                         local WeldStair = weld(PartStair,PartStair,Core,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(70+change,-1+change,5))
  1509.                         change = change - 1
  1510.                         if colorswap == White then colorswap = Black else colorswap = White end
  1511.                     end
  1512.                    
  1513.                     colorswap = White
  1514.                     change = 0
  1515.                     local PartBaseStair1 = new(MapGroup,0,0,false,false,colorswap,"BaseStrPart",Vector3.new(5,1,11),"")
  1516.                     local WeldStair1 = weld(PartBaseStair1,PartBaseStair1,Core,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(67,-22,-5))
  1517.                    
  1518.                     local PartBaseStair2 = new(MapGroup,0,0,false,false,colorswap,"BaseStrPart",Vector3.new(10,1,3),"")
  1519.                     local WeldStair2 = weld(PartBaseStair2,PartBaseStair2,PartBaseStair1,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(-7.5,0,-4))
  1520.                    
  1521.                     local PartBaseStair3 = new(MapGroup,0,0,false,false,colorswap,"BaseStrPart",Vector3.new(10,1,3),"")
  1522.                     local WeldStair3 = weld(PartBaseStair3,PartBaseStair3,PartBaseStair1,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(-7.5,0,4))
  1523.                    
  1524.                     local PartBaseStair4 = new(MapGroup,0,0,false,false,colorswap,"BaseStrPart",Vector3.new(5,1,11),"")
  1525.                     local WeldStair4 = weld(PartBaseStair4,PartBaseStair4,PartBaseStair1,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(-15,0,0))
  1526.                    
  1527.                     for i = 1 , 10 do
  1528.                         local PartStair = new(MapGroup,0,0,false,false,colorswap,"Part",Vector3.new(1,1,5),"")
  1529.                         local WeldStair = weld(PartStair,PartStair,Core,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(55+change,-12-change,-5))
  1530.                         change = change + 1
  1531.                         if colorswap == White then colorswap = Black else colorswap = White end
  1532.                     end
  1533.                    
  1534.                     colorswap = Black
  1535.                     change = 0
  1536.                     PartBaseStair1 = new(MapGroup,0,0,false,false,colorswap,"BaseStrPart",Vector3.new(5,1,11),"")
  1537.                     WeldStair1 = weld(PartBaseStair1,PartBaseStair1,Core,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(67,-33,5))
  1538.                    
  1539.                     PartBaseStair2 = new(MapGroup,0,0,false,false,colorswap,"BaseStrPart",Vector3.new(10,1,3),"")
  1540.                     WeldStair2 = weld(PartBaseStair2,PartBaseStair2,PartBaseStair1,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(-7.5,0,-4))
  1541.                    
  1542.                     PartBaseStair3 = new(MapGroup,0,0,false,false,colorswap,"BaseStrPart",Vector3.new(10,1,3),"")
  1543.                     WeldStair3 = weld(PartBaseStair3,PartBaseStair3,PartBaseStair1,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(-7.5,0,4))
  1544.                    
  1545.                     PartBaseStair4 = new(MapGroup,0,0,false,false,colorswap,"BaseStrPart",Vector3.new(5,1,11),"")
  1546.                     WeldStair4 = weld(PartBaseStair4,PartBaseStair4,PartBaseStair1,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(-15,0,0))
  1547.                    
  1548.                     for i = 1 , 10 do
  1549.                         local PartStair = new(MapGroup,0,0,false,false,colorswap,"Part",Vector3.new(1,1,5),"")
  1550.                         local WeldStair = weld(PartStair,PartStair,Core,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(64+change,-23+change,5))
  1551.                         change = change - 1
  1552.                         if colorswap == White then colorswap = Black else colorswap = White end
  1553.                     end
  1554.                    
  1555.                     colorswap = White
  1556.                     change = 0
  1557.                     for i = 1 , 10 do
  1558.                         local PartStair = new(MapGroup,0,0,false,false,colorswap,"Part",Vector3.new(1,1,5),"")
  1559.                         local WeldStair = weld(PartStair,PartStair,Core,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(55+change,-34-change,-5))
  1560.                         change = change + 1
  1561.                         if colorswap == White then colorswap = Black else colorswap = White end
  1562.                     end
  1563.                    
  1564.                     spawn(function()
  1565.                         comfirm(MapGroup)
  1566.                         anchored(MapGroup)
  1567.                     end)
  1568.                 end)
  1569.                
  1570.                 MapGroup:MoveTo(Vector3.new(Mouse.Hit.X,Mouse.Target.Position.Y,Mouse.Hit.Z))
  1571.                 debounce = true
  1572.                 debouce_execute[1] = false
  1573.             end)
  1574.         end
  1575.     };
  1576.    
  1577.     ["Grass"] = {
  1578.         Create = function()
  1579.             local debounce = false
  1580.             Mouse.Button1Up:connect(function()
  1581.                 if debounce == true then
  1582.                     return
  1583.                 end
  1584.                 local MapGroup = Instance.new("Model",workspace)
  1585.                 MapGroup.Name = "Map"
  1586.                 local Core = new(MapGroup,0,0,false,true,Color3.fromRGB(0,205,0),"Core",Vector3.new(250,1,200),"")
  1587.                 Core.Material = "Grass"
  1588.                 local Part1 = new(MapGroup,0,0,false,false,Black,"Part",Vector3.new(2,75,2),"")
  1589.                 local Part2 = new(MapGroup,0,0,false,false,Black,"Part",Vector3.new(2,75,2),"")
  1590.                 local Part3 = new(MapGroup,0,0,false,false,Black,"Part",Vector3.new(2,75,2),"")
  1591.                 local Part4 = new(MapGroup,0,0,false,false,Black,"Part",Vector3.new(2,75,2),"")
  1592.                
  1593.                 local Part5 = new(MapGroup,0,0,false,false,Black,"Part",Vector3.new(250,2,2),"")
  1594.                 local Part6 = new(MapGroup,0,0,false,false,Black,"Part",Vector3.new(250,2,2),"")
  1595.                 local Part7 = new(MapGroup,0,0,false,false,Black,"Part",Vector3.new(2,2,200),"")
  1596.                 local Part8 = new(MapGroup,0,0,false,false,Black,"Part",Vector3.new(2,2,200),"")
  1597.                
  1598.                 local Part9 = new(MapGroup,0,0.75,false,false,Color3.fromRGB(0,0,155),"Glass",Vector3.new(246,75,0.5),"")
  1599.                 local Part10 = new(MapGroup,0,0.75,false,false,Color3.fromRGB(0,0,155),"Glass",Vector3.new(246,75,0.5),"")
  1600.                 local Part11 = new(MapGroup,0,0.75,false,false,Color3.fromRGB(0,0,155),"Glass",Vector3.new(0.5,75,198),"")
  1601.                 local Part12 = new(MapGroup,0,0.75,false,false,Color3.fromRGB(0,0,155),"Glass",Vector3.new(0.5,75,198),"")
  1602.                
  1603.                 local Weld1 = weld(Part1,Part1,Core,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(124,-38,99))
  1604.                 local Weld2 = weld(Part2,Part2,Core,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(124,-38,-99))
  1605.                 local Weld3 = weld(Part3,Part3,Core,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(-124,-38,99))
  1606.                 local Weld4 = weld(Part4,Part4,Core,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(-124,-38,-99))
  1607.                
  1608.                 local Weld5 = weld(Part5,Part5,Core,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(0,-76.5,99))
  1609.                 local Weld6 = weld(Part6,Part6,Core,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(0,-76.5,-99))
  1610.                 local Weld7 = weld(Part7,Part7,Core,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(99,-76.5,0))
  1611.                 local Weld8 = weld(Part8,Part8,Core,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(-99,-76.5,0))
  1612.                
  1613.                 local Weld9 = weld(Part9,Part9,Core,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(0,-38,99))
  1614.                 local Weld10 = weld(Part10,Part10,Core,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(0,-38,-99))
  1615.                 local Weld11 = weld(Part11,Part11,Core,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(99,-38,0))
  1616.                 local Weld12 = weld(Part12,Part12,Core,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(-99,-38,0))
  1617.                 spawn(function()
  1618.                     anchored(MapGroup)
  1619.                     comfirm(MapGroup)
  1620.                 end)
  1621.                 MapGroup:MoveTo(Vector3.new(Mouse.Hit.X,Mouse.Target.Position.Y,Mouse.Hit.Z))
  1622.                 debounce = true
  1623.                 debouce_execute[1] = false
  1624.             end)
  1625.         end
  1626.     };
  1627. }
  1628.  
  1629. ------------------------------------------------------------------------------------------------------------------------------------------------
  1630.  
  1631. -- Flying Function
  1632.  
  1633. ------------------------------------------------------------------------------------------------------------------------------------------------
  1634.  
  1635. local rad = math.rad
  1636.  
  1637. local keysDown = {}
  1638. local flySpeed = 0
  1639. local MAX_FLY_SPEED = 150
  1640.  
  1641. local flyToggled = false
  1642. local canFly = false
  1643. local forward, side = 0, 0
  1644. local lastForward, lastSide = 0, 0
  1645.  
  1646. local floatBP = Instance.new("BodyPosition")
  1647. floatBP.maxForce = Vector3.new(0, math.huge, 0)
  1648. local flyBV = Instance.new("BodyVelocity")
  1649. flyBV.maxForce = Vector3.new(9e9, 9e9, 9e9)
  1650. local turnBG = Instance.new("BodyGyro")
  1651. turnBG.maxTorque = Vector3.new(math.huge, math.huge, math.huge)
  1652.  
  1653. local function updateFly()
  1654.  
  1655.     if not flyToggled then return end
  1656.    
  1657.     lastForward = forward
  1658.     lastSide = side
  1659.    
  1660.     forward = 0
  1661.     side = 0
  1662.    
  1663.     if keysDown.w then
  1664.         forward = forward + 1
  1665.     end
  1666.     if keysDown.s then
  1667.         forward = forward - 1
  1668.     end
  1669.     if keysDown.a then
  1670.         side = side - 1
  1671.     end
  1672.     if keysDown.d then
  1673.         side = side + 1
  1674.     end
  1675.  
  1676.    
  1677.     canFly = (forward ~= 0 or side ~= 0)
  1678.    
  1679.     if canFly then
  1680.         stanceToggle = "Floating"
  1681.         turnBG.Parent = HumanoidRootPart
  1682.         floatBP.Parent = nil
  1683.         flyBV.Parent = HumanoidRootPart
  1684.        
  1685.         flySpeed = flySpeed + 1 + (flySpeed / MAX_FLY_SPEED)
  1686.         if flySpeed > MAX_FLY_SPEED then flySpeed = MAX_FLY_SPEED end
  1687.     else
  1688.         floatBP.position = Vector3.new(HumanoidRootPart.Position.X,HumanoidRootPart.Position.Y+0.01962,HumanoidRootPart.Position.Z)
  1689.         floatBP.Parent = HumanoidRootPart
  1690.        
  1691.         flySpeed = flySpeed - 1
  1692.         if flySpeed < 0 then flySpeed = 0 end
  1693.     end
  1694.    
  1695.     local camCF = Camera.CoordinateFrame
  1696.     local in_forward = canFly and forward or lastForward
  1697.     local in_side = canFly and side or lastSide
  1698.    
  1699.     flyBV.velocity = ((camCF.lookVector * in_forward) + (camCF * CFrame.new(in_side,
  1700.         in_forward * 0.2, 0).p) - camCF.p) * flySpeed
  1701.    
  1702.     turnBG.cframe = camCF * CFrame.Angles(-rad(forward * (flySpeed / MAX_FLY_SPEED)), 0,
  1703.         0)
  1704. end
  1705.  
  1706. game:service'RunService'.RenderStepped:connect(function()
  1707.     if flyToggled then
  1708.         stanceToggle = "Floating"
  1709.     end
  1710.     updateFly()
  1711. end)
  1712.  
  1713. ------------------------------------------------------------------------------------------------------------------------------------------------
  1714.  
  1715. -- OverHead-Text Function
  1716.  
  1717. ------------------------------------------------------------------------------------------------------------------------------------------------
  1718.  
  1719. local txt = Instance.new("BillboardGui", Char)
  1720. txt.Adornee = Char .Head
  1721. txt.Name = "_status"
  1722. txt.Size = UDim2.new(2, 0, 1.2, 0)
  1723. txt.StudsOffset = Vector3.new(-9, 7, 0)
  1724.  
  1725. local otext = Instance.new("TextLabel", txt)
  1726. otext.Size = UDim2.new(10, 0, 7, 0)
  1727. otext.FontSize = "Size24"
  1728. otext.TextScaled = true
  1729. otext.TextTransparency = 0
  1730. otext.BackgroundTransparency = 1
  1731. otext.TextTransparency = 0
  1732. otext.TextStrokeTransparency = 0
  1733. otext.Font = "Code"
  1734. otext.TextStrokeColor3 = Color3.new(0,0,0)
  1735. otext.TextColor3 = Color3.fromRGB(255,255,255)
  1736. otext.Text = "Creator"
  1737.  
  1738. function load_overheadtext(text,color)
  1739. otext.Text = text
  1740. otext.TextColor3 = color
  1741. end
  1742.  
  1743. local ChangeSoundID = idSounds[4]
  1744. local VolumeSound = 1
  1745. local PitchSound = 1
  1746. local RemoveSound = false
  1747.  
  1748. local MainMusic = Instance.new("Sound",Head)
  1749. MainMusic.Name = "Music"
  1750. MainMusic.SoundId = "rbxassetid://" ..ChangeSoundID
  1751. MainMusic.Volume = 1
  1752. MainMusic.Playing = true
  1753. MainMusic.TimePosition = 0
  1754. MainMusic.PlaybackSpeed = 1
  1755. MainMusic.Pitch = 1
  1756. MainMusic.Looped = true
  1757.  
  1758. spawn(function()
  1759.     while wait() do
  1760.         if RemoveSound == true then
  1761.             MainMusic:Destroy()
  1762.             break
  1763.         end
  1764.         MainMusic.SoundId = "rbxassetid://" ..ChangeSoundID
  1765.         MainMusic.Looped = true
  1766.         MainMusic.Pitch = PitchSound
  1767.         MainMusic.Volume = VolumeSound
  1768.         MainMusic.Parent = Head
  1769.         MainMusic:Resume()
  1770.     end
  1771. end)
  1772.  
  1773. ------------------------------------------------------------------------------------------------------------------------------------------------
  1774.  
  1775. -- Decortion&Fun Function
  1776.  
  1777. ------------------------------------------------------------------------------------------------------------------------------------------------
  1778.  
  1779. ------------------------------------
  1780.  
  1781. --          Animation;            --
  1782.  
  1783. ------------------------------------
  1784.  
  1785. function clerp(a,b,t)
  1786. local qa = {QuaternionFromCFrame(a)}
  1787. local qb = {QuaternionFromCFrame(b)}
  1788. local ax, ay, az = a.x, a.y, a.z
  1789. local bx, by, bz = b.x, b.y, b.z
  1790. local _t = 1-t
  1791. return QuaternionToCFrame(_t*ax + t*bx, _t*ay + t*by, _t*az + t*bz,QuaternionSlerp(qa, qb, t))
  1792. end
  1793.  
  1794. function QuaternionFromCFrame(cf)
  1795. local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
  1796. local trace = m00 + m11 + m22
  1797. if trace > 0 then
  1798. local s = math.sqrt(1 + trace)
  1799. local recip = 0.5/s
  1800. return (m21-m12)*recip, (m02-m20)*recip, (m10-m01)*recip, s*0.5
  1801. else
  1802. local i = 0
  1803. if m11 > m00 then
  1804. i = 1
  1805. end
  1806. if m22 > (i == 0 and m00 or m11) then
  1807. i = 2
  1808. end
  1809. if i == 0 then
  1810. local s = math.sqrt(m00-m11-m22+1)
  1811. local recip = 0.5/s
  1812. return 0.5*s, (m10+m01)*recip, (m20+m02)*recip, (m21-m12)*recip
  1813. elseif i == 1 then
  1814. local s = math.sqrt(m11-m22-m00+1)
  1815. local recip = 0.5/s
  1816. return (m01+m10)*recip, 0.5*s, (m21+m12)*recip, (m02-m20)*recip
  1817. elseif i == 2 then
  1818. local s = math.sqrt(m22-m00-m11+1)
  1819. local recip = 0.5/s return (m02+m20)*recip, (m12+m21)*recip, 0.5*s, (m10-m01)*recip
  1820. end
  1821. end
  1822. end
  1823.  
  1824. function QuaternionToCFrame(px, py, pz, x, y, z, w)
  1825. local xs, ys, zs = x + x, y + y, z + z
  1826. local wx, wy, wz = w*xs, w*ys, w*zs
  1827. local xx = x*xs
  1828. local xy = x*ys
  1829. local xz = x*zs
  1830. local yy = y*ys
  1831. local yz = y*zs
  1832. local zz = z*zs
  1833. return CFrame.new(px, py, pz,1-(yy+zz), xy - wz, xz + wy,xy + wz, 1-(xx+zz), yz - wx, xz - wy, yz + wx, 1-(xx+yy))
  1834. end
  1835.  
  1836. function QuaternionSlerp(a, b, t)
  1837. local cosTheta = a[1]*b[1] + a[2]*b[2] + a[3]*b[3] + a[4]*b[4]
  1838. local startInterp, finishInterp;
  1839. if cosTheta >= 0.0001 then
  1840. if (1 - cosTheta) > 0.0001 then
  1841. local theta = math.acos(cosTheta)
  1842. local invSinTheta = 1/math.sin(theta)
  1843. startInterp = math.sin((1-t)*theta)*invSinTheta
  1844. finishInterp = math.sin(t*theta)*invSinTheta  
  1845. else
  1846. startInterp = 1-t
  1847. finishInterp = t
  1848. end
  1849. else
  1850. if (1+cosTheta) > 0.0001 then
  1851. local theta = math.acos(-cosTheta)
  1852. local invSinTheta = 1/math.sin(theta)
  1853. startInterp = math.sin((t-1)*theta)*invSinTheta
  1854. finishInterp = math.sin(t*theta)*invSinTheta
  1855. else
  1856. startInterp = t-1
  1857. finishInterp = t
  1858. end
  1859. end
  1860. return a[1]*startInterp + b[1]*finishInterp, a[2]*startInterp + b[2]*finishInterp, a[3]*startInterp + b[3]*finishInterp, a[4]*startInterp + b[4]*finishInterp
  1861. end
  1862.  
  1863. function swait(num)
  1864.     if num==0 or num==nil then
  1865.         game:service'RunService'.Heartbeat:wait(0)
  1866.     else
  1867.     for i=0,num do
  1868.         game:service'RunService'.Heartbeat:wait(0)
  1869.     end
  1870.     end
  1871. end
  1872.    
  1873. --RS.Parent = nil
  1874. --LS.Parent = nil
  1875.  
  1876. local RW = Instance.new("Weld",Torso)
  1877. local LW = Instance.new("Weld",Torso)
  1878.  
  1879. RW.Name = "Right Shoulder"
  1880. RW.Part0 = Torso
  1881. RW.Part1 = RightArm
  1882. RW.C0 = cf(1.5, 0.5, 0)
  1883. RW.C1 = cf(0, 0.5, 0)
  1884.  
  1885. LW.Name = "Left Shoulder"
  1886. LW.Part0 = Torso
  1887. LW.Part1 = LeftArm
  1888. LW.C0 = cf(-1.5, 0.5, 0)
  1889. LW.C1 = cf(0, 0.5, 0)
  1890.  
  1891. local RH = Instance.new("Weld",Torso)
  1892. local LH = Instance.new("Weld",Torso)
  1893. local HW = Instance.new("Weld",Torso)
  1894. local TW = Instance.new("Weld",Torso)
  1895.  
  1896. RH.Name = "Right Hip"
  1897. RH.Part0 = Torso
  1898. RH.C0 = cf(0.5, -2, 0)
  1899. RH.C1 = cf(0, 0, 0)
  1900.  
  1901. LH.Name = "Left Hip"
  1902. LH.Part0 = Torso
  1903. LH.C0 = cf(-0.5, -2, 0)
  1904. LH.C1 = cf(0, 0, 0)
  1905.  
  1906. HW.Name = "Neck"
  1907. HW.Part0 = Torso
  1908. HW.C0 = cf(0, 1.5, 0)
  1909. HW.C1 = cf(0, 0, 0)
  1910.  
  1911. RH.Part1 = RightLeg
  1912. LH.Part1 = LeftLeg
  1913. HW.Part1 = Head
  1914.  
  1915. local animpose = "Standing"
  1916. local Mode = "Normal"
  1917. local holding = false
  1918. local change = 1
  1919. local sine = 0
  1920. local val = 3
  1921. local rs_event = 1
  1922. local max_rs_event = 2500
  1923.  
  1924. Loop:connect(function()
  1925.     NewSpawnLocation()
  1926.     NewLeaderStats()
  1927.     coroutine.resume(coroutine.create(GetColorModePototype))
  1928.    
  1929.     swait()
  1930.     sine = sine + change
  1931.     rs_event = rs_event + math.random(1,3)
  1932.     local torvel = (HumanoidRootPart.Velocity*Vector3.new(1,0,1)).magnitude
  1933.     local hitfloor,posfloor = rayCast(HumanoidRootPart.Position,(CFrame.new(HumanoidRootPart.Position,HumanoidRootPart.Position - Vector3.new(0,1,0))).lookVector,4,Char)      
  1934.    
  1935.     if rs_event >= max_rs_event then
  1936.         rs_event = 0
  1937.         max_rs_event = max_rs_event + math.random(100,350)
  1938.     end
  1939.     if stanceToggle == "Floating" then
  1940.         if torvel >= 2 then
  1941.             animpose = "Flying"
  1942.             change = 2
  1943.             RootJoint.C0 = clerp(RootJoint.C0,RootCF*cf(0,0,0.5*math.cos(sine/40))      * angles(math.rad(10),math.rad(0),math.rad(0)),.2)
  1944.             HW.C0 = clerp(HW.C0, CFrame.new(0, 1.5, 0)                                  * angles(math.rad(-10-4*math.cos(sine/40)),math.rad(0),math.rad(0)),.3)
  1945.             RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.60+0.10*math.cos(sine/40), 0)        * angles(math.rad(0), math.rad(0), math.rad(12.5+5*math.cos(sine/40))), 0.2)
  1946.             LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.60+0.10*math.cos(sine/40), 0)       * angles(math.rad(0), math.rad(0), math.rad(-12.5-5*math.cos(sine/40))), 0.2)
  1947.             RH.C0 = clerp(RH.C0, cf(0.6,-2-0.05*math.cos(sine/40),0)                    * angles(math.rad(0),math.rad(0),math.rad(5+0.5*math.cos(sine/40))),.1)
  1948.             LH.C0 = clerp(LH.C0, cf(-0.6,-2-0.05*math.cos(sine/40),0)                   * angles(math.rad(0),math.rad(0),math.rad(-5-0.5*math.cos(sine/40))),.1)      
  1949.         end
  1950.         if torvel <= 2 then
  1951.             if rs_event >= 1800 then
  1952.                 animpose = "rs_Standing"
  1953.                 RootJoint.C0 = clerp(RootJoint.C0,RootCF*cf(0,0,0.25*math.cos(sine/40))     * angles(math.rad(0),math.rad(0),math.rad(0)),.2)
  1954.                 HW.C0 = clerp(HW.C0, CFrame.new(0, 1.5, 0)                                  * angles(math.rad(-10-4*math.cos(sine/40)),math.rad(0),math.rad(0)),.3)
  1955.                 RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.60+0.10*math.cos(sine/40), 0)        * angles(math.rad(0), math.rad(0), math.rad(12.5+5*math.cos(sine/40))), 0.2)
  1956.                
  1957.                 LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0)            * angles(math.rad(0), math.rad(-70), math.rad(-70)), 0.1)
  1958.                
  1959.                 RH.C0 = clerp(RH.C0, cf(0.6,-2-0.05*math.cos(sine/40),0)                    * angles(math.rad(0),math.rad(0),math.rad(5+0.5*math.cos(sine/40))),.1)
  1960.                 LH.C0 = clerp(LH.C0, cf(-0.6,-2-0.05*math.cos(sine/40),0)                   * angles(math.rad(0),math.rad(0),math.rad(-5-0.5*math.cos(sine/40))),.1)
  1961.                 if rs_event >= 1870 then
  1962.                     RootJoint.C0 = clerp(RootJoint.C0,RootCF*cf(0,0,0.25*math.cos(sine/40))     * angles(math.rad(0),math.rad(0),math.rad(0)),.2)
  1963.                     HW.C0 = clerp(HW.C0, CFrame.new(0, 1.5, 0)                                  * angles(math.rad(-10-4*math.cos(sine/40)),math.rad(0),math.rad(0)),.3)
  1964.                     RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.60+0.10*math.cos(sine/40), 0)        * angles(math.rad(0), math.rad(0), math.rad(12.5+5*math.cos(sine/40))), 0.2)          
  1965.                    
  1966.                     LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0)        * angles(math.rad(0), math.rad(-180), math.rad(-130)), 0.1)
  1967.                    
  1968.                     RH.C0 = clerp(RH.C0, cf(0.6,-2-0.05*math.cos(sine/40),0)                    * angles(math.rad(0),math.rad(0),math.rad(5+0.5*math.cos(sine/40))),.1)
  1969.                     LH.C0 = clerp(LH.C0, cf(-0.6,-2-0.05*math.cos(sine/40),0)                   * angles(math.rad(0),math.rad(0),math.rad(-5-0.5*math.cos(sine/40))),.1)
  1970.                     load_rsStand_effect()
  1971.                     return rs_event
  1972.                 end
  1973.             end
  1974.             animpose = "NotFlying"
  1975.             change = 2.5
  1976.             RootJoint.C0 = clerp(RootJoint.C0,RootCF*cf(0,0,0.5*math.cos(sine/40))      * angles(math.rad(0),math.rad(0),math.rad(0)),.2)
  1977.             HW.C0 = clerp(HW.C0, CFrame.new(0, 1.5, 0)                                  * angles(math.rad(-10-4*math.cos(sine/40)),math.rad(0),math.rad(0)),.3)
  1978.             RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.60+0.10*math.cos(sine/40), 0)        * angles(math.rad(0), math.rad(0), math.rad(12.5+5*math.cos(sine/40))), 0.2)
  1979.             LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.60+0.10*math.cos(sine/40), 0)       * angles(math.rad(0), math.rad(0), math.rad(-12.5-5*math.cos(sine/40))), 0.2)
  1980.             RH.C0 = clerp(RH.C0, cf(0.6,-2-0.05*math.cos(sine/40),0)                    * angles(math.rad(0),math.rad(0),math.rad(5+0.5*math.cos(sine/40))),.1)
  1981.             LH.C0 = clerp(LH.C0, cf(-0.6,-2-0.05*math.cos(sine/40),0)                   * angles(math.rad(0),math.rad(0),math.rad(-5-0.5*math.cos(sine/40))),.1)
  1982.         end
  1983.     -- Jump
  1984.     elseif HumanoidRootPart.Velocity.y > 1 and hitfloor == nil then
  1985.         rs_event = 0
  1986.         if Mode == "Normal" then
  1987.             animpose = "Jumping"
  1988.             RootJoint.C0 = clerp(RootJoint.C0,RootCF*cf(0,0,0)       * angles(math.rad(0),math.rad(0),math.rad(0)),.1)
  1989.             HW.C0 = clerp(HW.C0,necko                                * angles(math.rad(20),math.rad(0),math.rad(0)),.3)
  1990.             RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0)             * angles(math.rad(-20), math.rad(0), math.rad(30)), 0.3)
  1991.             LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0)            * angles(math.rad(-20), math.rad(0), math.rad(-30)), 0.3)
  1992.             RH.C0 = clerp(RH.C0, cf(0.5, -2, 0)                      * angles(math.rad(0),math.rad(0),math.rad(0)),.3)
  1993.             LH.C0 = clerp(LH.C0, cf(-0.5, -2, 0)                     * angles(math.rad(0),math.rad(0),math.rad(0)),.1)
  1994.         end
  1995.         if Mode == "Cyber" then
  1996.             RootJoint.C0 = clerp(RootJoint.C0,RootCF*cf(0,0,0)       * angles(math.rad(0),math.rad(0),math.rad(0)),.1)
  1997.             HW.C0 = clerp(HW.C0,necko                                * angles(math.rad(20),math.rad(0),math.rad(0)),.3)
  1998.             RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0)             * angles(math.rad(0), math.rad(0), math.rad(100)), 0.2)
  1999.             LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0)            * angles(math.rad(0), math.rad(0), math.rad(-100)), 0.2)
  2000.             RH.C0 = clerp(RH.C0, cf(0.5,-1.5,-0.3)                   * angles(math.rad(-7-2*math.cos(sine/32)),math.rad(0),math.rad(0)),.3)
  2001.             LH.C0 = clerp(LH.C0, cf(-0.5, -1.9, 0.075)               * angles(math.rad(-4-1*math.cos(sine/32)),math.rad(0),math.rad(0)),.1)
  2002.         end
  2003.     -- Fall
  2004.     elseif HumanoidRootPart.Velocity.y < -1 and hitfloor == nil then
  2005.         rs_event = 0
  2006.         if Mode == "Normal" then
  2007.             animpose = "Freefalling"
  2008.             RootJoint.C0 = clerp(RootJoint.C0,RootCF*cf(0,0,0)       * angles(math.rad(0),math.rad(0),math.rad(0)),.1)
  2009.             HW.C0 = clerp(HW.C0,necko                                * angles(math.rad(-20),math.rad(0),math.rad(0)),.3)
  2010.             RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0)             * angles(math.rad(-30), math.rad(0), math.rad(50)), 0.2)
  2011.             LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0)            * angles(math.rad(-30), math.rad(0), math.rad(-50)), 0.2)
  2012.             RH.C0 = clerp(RH.C0, cf(0.5, -2, 0)                      * angles(math.rad(0),math.rad(0),math.rad(0)),.3)
  2013.             LH.C0 = clerp(LH.C0, cf(-0.5, -2, 0)                     * angles(math.rad(0),math.rad(0),math.rad(0)),.1)
  2014.         end
  2015.         if Mode == "Cyber" then
  2016.             RootJoint.C0 = clerp(RootJoint.C0,RootCF*cf(0,0,0)       * angles(math.rad(0),math.rad(0),math.rad(0)),.1)
  2017.             HW.C0 = clerp(HW.C0,necko                                * angles(math.rad(-20),math.rad(0),math.rad(0)),.3)
  2018.             RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0)             * angles(math.rad(-30), math.rad(0), math.rad(50)), 0.2)
  2019.             LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0)            * angles(math.rad(-30), math.rad(0), math.rad(-50)), 0.2)
  2020.             RH.C0 = clerp(RH.C0, cf(0.5,-1.5,-0.3)                   * angles(math.rad(-7-2*math.cos(sine/32)),math.rad(0),math.rad(0)),.3)
  2021.             LH.C0 = clerp(LH.C0, cf(-0.5, -1.9, 0.075)               * angles(math.rad(-4-1*math.cos(sine/32)),math.rad(0),math.rad(0)),.1)
  2022.         end
  2023.     -- Idle
  2024.     elseif torvel < 1 and hitfloor ~=nil then
  2025.         if Mode == "Normal" then
  2026.             animpose = "Standing"
  2027.             RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,0) * angles(math.rad(0+1*math.cos(sine/34)),math.rad(0),math.rad(0)),.1)
  2028.             HW.C0 = clerp(HW.C0,necko                                * angles(math.rad(-5),math.rad(0),math.rad(0)),.1)        
  2029.             Torso.Neck.C0=clerp(Torso.Neck.C0,necko*angles(math.rad(15 - 2.5 * math.cos(sine / 28)),math.rad(0),math.rad(0)),.1)
  2030.             RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0)             * angles(math.rad(-10), math.rad(0), math.rad(20+5*math.cos(sine/28))), 0.3)
  2031.             LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0)            * angles(math.rad(0), math.rad(0), math.rad(-20-5*math.cos(sine/28))), 0.1)          
  2032.             RH.C0 = clerp(RH.C0, cf(0.625,-1.95,0.1)                 * angles(math.rad(-8+2*math.cos(sine/28)),math.rad(0),math.rad(13)),.3)
  2033.             LH.C0 = clerp(LH.C0, cf(-0.65,-1.95,-0.1)                * angles(math.rad(5-1*math.cos(sine/28)),math.rad(0),math.rad(-16)),.1)
  2034.             if rs_event >= 1800 then
  2035.                 LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0)            * angles(math.rad(0), math.rad(-70), math.rad(-70)), 0.1)
  2036.                 if rs_event >= 1870 then
  2037.                     LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0)        * angles(math.rad(0), math.rad(-180), math.rad(-130)), 0.1)
  2038.                     load_rsStand_effect()
  2039.                 end
  2040.             end
  2041.         end
  2042.         if Mode == "Cyber" then
  2043.             animpose = "Standing"
  2044.             change = 2.35
  2045.             RootJoint.C0 = clerp(RootJoint.C0,RootCF*cf(0,0,0.75-0.4*math.cos(sine/32)) * angles(math.rad(0),math.rad(0),math.rad(5)),.075)
  2046.             HW.C0 = clerp(HW.C0,necko                                * angles(math.rad(-10),math.rad(0),math.rad(-5)),.1)
  2047.             RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0)             * angles(math.rad(0), math.rad(0), math.rad(70-5*math.cos(sine/32))), 0.1)
  2048.             LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0)            * angles(math.rad(0), math.rad(0), math.rad(-20+12*math.cos(sine/32))), 0.1)
  2049.             RH.C0 = clerp(RH.C0, cf(0.5,-1.5,-0.3)                   * angles(math.rad(-7-2*math.cos(sine/32)),math.rad(0),math.rad(0)),.3)
  2050.             LH.C0 = clerp(LH.C0, cf(-0.5, -1.9, 0.075)               * angles(math.rad(-4-1*math.cos(sine/32)),math.rad(0),math.rad(0)),.1)
  2051.         end
  2052.     -- Walking
  2053.     elseif torvel >= 1 and hitfloor ~=nil then
  2054.         rs_event = 0
  2055.         if Mode == "Normal" then
  2056.             animpose = "Walking"
  2057.             val = torvel * 0.175
  2058.             change = val + 0.75
  2059.             RootJoint.C0=clerp(RootJoint.C0,RootCF*cf(0,0,0)         * angles(math.rad(0+1*math.cos(sine/34)),math.rad(0),math.rad(0)),.1)
  2060.             HW.C0 = clerp(HW.C0,necko                                * angles(math.rad(-5),math.rad(0),math.rad(0)),.1)        
  2061.             Torso.Neck.C0=clerp(Torso.Neck.C0,necko                  * angles(math.rad(15-2.5*math.cos(sine/28)),math.rad(0),math.rad(0)),.1)
  2062.             RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0)             * angles(math.rad(-10+15*math.cos(sine/28)), math.rad(0), math.rad(20+2.5*math.cos(sine/28))), 0.3)
  2063.             LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0)            * angles(math.rad(0-20*math.cos(sine/28)), math.rad(0), math.rad(-20-2.5*math.cos(sine/28))), 0.1)        
  2064.             LH.C0 = clerp(LH.C0,CFrame.new(-0.5,-2+0.14*math.cos(sine/32)/2.8,-0.05+ math.sin(sine/32)/3.4) * angles(math.rad(-10) + -math.sin(sine/32)/2.3, 0, 0), .4)
  2065.             RH.C0 = clerp(RH.C0,CFrame.new(0.5,-2-0.14*math.cos(sine/32)/2.8,-0.05+ -math.sin(sine/32)/3.4) * angles(math.rad(-10) + math.sin(sine/32)/2.3, 0, 0), .4)        
  2066.            
  2067.             --RH.C0 = clerp(RH.C0, cf(0.55, -2, 0)* angles(math.rad(-20+30*math.cos(sine/28)),math.rad(0),math.rad(3.5)),.3)
  2068.             --LH.C0 = clerp(LH.C0, cf(-0.55, -2, 0) * angles(math.rad(-20+30*math.cos(sine/28)),math.rad(0),math.rad(-3.5)),.1)
  2069.         end
  2070.         if Mode == "Cyber" then
  2071.             animpose = "Walking"
  2072.             val = torvel * 0.175
  2073.             change = val
  2074.             RootJoint.C0 = clerp(RootJoint.C0,RootCF*cf(0,0,0.35)    * angles(math.rad(40-5*math.cos(sine/30)),math.rad(0),math.rad(0)),.075)
  2075.             HW.C0 = clerp(HW.C0,necko                                * angles(math.rad(0),math.rad(0),math.rad(0)),.1)
  2076.             RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0)             * angles(math.rad(0), math.rad(0), math.rad(20-5*math.cos(sine/20))), 0.1)
  2077.             LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0)            * angles(math.rad(0), math.rad(0), math.rad(-20-5*math.cos(sine/20))), 0.1)
  2078.             RH.C0 = clerp(RH.C0, cf(0.5,-1.5,-0.3)                   * angles(math.rad(-7-2*math.cos(sine/32)),math.rad(0),math.rad(0)),.3)
  2079.             LH.C0 = clerp(LH.C0, cf(-0.5, -1.9, 0.075)               * angles(math.rad(-4-1*math.cos(sine/32)),math.rad(0),math.rad(0)),.1)
  2080.         end
  2081.     end
  2082. end)
  2083.  
  2084. --------------------------------------
  2085. --                                  --
  2086. --              Effect;             --
  2087. --                                  --
  2088. --------------------------------------
  2089.  
  2090. local SameColorMode = Color3.fromRGB(255,255,255)
  2091.  
  2092. function GetColorModePototype()
  2093.     if Mode == "Normal" then
  2094.         SameColorMode = Color3.fromRGB(255,255,255)
  2095.     elseif Mode == "Cyber" then
  2096.         SameColorMode = Color3.fromRGB(0,255,255)
  2097.     end
  2098. end
  2099.  
  2100. function load_normaleffect()
  2101.     local samei
  2102.     if Mode == "Normal" then
  2103.         samei = BrickColor.White()
  2104.     end
  2105.     if Mode == "Cyber" then
  2106.         samei = BrickColor.new("Cyan")
  2107.     end
  2108.    
  2109.         spawn(function()
  2110.             local function lerp(a,b,c)
  2111.                 return a+(b-a)*c  
  2112.             end
  2113.             local function rndRange(rng)
  2114.                 return math.random(-rng*1000,rng*1000)/1000
  2115.             end
  2116.             local magik = Instance.new("Part", RightArm)
  2117.             magik.Anchored = true
  2118.             magik.Locked = true
  2119.             magik.Material = "Neon"
  2120.             magik.FormFactor = "Custom"
  2121.             magik.Size = Vector3.new(1.2, 1.2, 1.2)
  2122.             magik.TopSurface = "Smooth"
  2123.             magik.BottomSurface = "Smooth"
  2124.             magik.Transparency = 0
  2125.             magik.CanCollide = false
  2126.                
  2127.             magik.BrickColor = samei
  2128.                
  2129.             local mr = math.rad
  2130.             local rnx,rny,rnz = mr(rndRange(180)),mr(rndRange(180)),mr(rndRange(180))
  2131.             local cf = RightArm.CFrame * CFrame.new(0, -.8, 0) * CFrame.Angles(rnx,rny,rnz)
  2132.             magik.CFrame = cf
  2133.             for i = 0, 1, .05 do
  2134.                 local newTrans = lerp(0.5, 1, i)
  2135.                 local ns = lerp(1,1.2,i)
  2136.                 magik.Transparency = newTrans
  2137.                 magik.Size = Vector3.new(ns,ns,ns)
  2138.                 magik.CFrame = cf
  2139.                 rs:wait()
  2140.             end
  2141.             magik:Destroy()
  2142.             wait()
  2143.         end)
  2144. end
  2145.  
  2146. local rs_debounce = false
  2147.  
  2148. function load_rsStand_effect()
  2149.     spawn(function()
  2150.         local TypingSub = 1
  2151.         if rs_debounce == false then
  2152.             rs_debounce = true
  2153.             local Code = [[
  2154.                 local Player = game.Players.LocalPlayer
  2155.                 local Mouse = Player:GetMouse()            
  2156.                 local ServerStorage = game:GetService("ServerStorage")            
  2157.                
  2158.                 local Start = function()
  2159.                     local Map = workspace:FindFirstChild("Map") or ServerStorage:FindFirstChild("Map")
  2160.                     Map.Parent = workspace or nil
  2161.                     if Map == nil then
  2162.                         print("Map Error#666")
  2163.                     else
  2164.                         print("Map Found")
  2165.                         local Tag = Instance.new("StringValue",Map)
  2166.                         Tag.Value = "Actived"
  2167.                     end
  2168.                 end
  2169.                
  2170.                 local Restart = function()
  2171.                     local Map = workspace:FindFirstChild("Map"):Clone()
  2172.                     Map.Parent = workpace
  2173.                     if Map.Parent == workpace then
  2174.                         local pos = game.Players.LocalPlayer.Character.HumanoidRootPart.Position
  2175.                         print("Map was restarted")
  2176.                         Map:MoveTo(pos)
  2177.                     else
  2178.                         print("Map Error#666")
  2179.                     end
  2180.                 end
  2181.                
  2182.                 local Shutdown = function()
  2183.                     local Map = workspace:FindFirstChild("Map"):Clone()
  2184.                     Map.Parnet = ServerStorage
  2185.                 end
  2186.                
  2187.                 function Load()
  2188.                     Start()
  2189.                     if Start then
  2190.                         Restart()
  2191.                     end
  2192.                 end
  2193.                
  2194.                 Mouse.KeyDown:connect(function(key)
  2195.                     if key == "o" then
  2196.                         Load()
  2197.                     end
  2198.                     if key == "i" then
  2199.                         Shutdown()
  2200.                     end
  2201.                 end)
  2202.             ]]
  2203.             local iscreen = Instance.new("Model",Char)
  2204.             local screenpaids = new(iscreen,0,0,false,false,Color3.fromRGB(255,255,255),"Part",Vector3.new(4,3,0.2),"")
  2205.             local weldscreen = weld(screenpaids,screenpaids,HumanoidRootPart,CFrame.fromEulerAnglesXYZ(0,0,0)*CFrame.new(0,-0.5,2.5))
  2206.            
  2207.             local Gui = Instance.new("SurfaceGui",screenpaids)
  2208.             Gui.Face = "Back"
  2209.             Gui.Adornee = screenpaids
  2210.            
  2211.             local TextC = Instance.new("TextBox",Gui)
  2212.             TextC.BackgroundTransparency = 1
  2213.             TextC.Position = UDim2.new(0, 0, 0, 0)
  2214.             TextC.Size = UDim2.new(1, 0, 1, 0)
  2215.             TextC.TextColor3 = Color3.new(1, 1, 1)
  2216.             TextC.Font = Enum.Font.Code
  2217.             TextC.Active = false
  2218.             TextC.MultiLine = true
  2219.             TextC.TextWrapped = true
  2220.             TextC.FontSize = Enum.FontSize.Size32
  2221.             TextC.TextXAlignment = Enum.TextXAlignment.Left
  2222.             TextC.TextYAlignment = Enum.TextYAlignment.Top
  2223.             TextC.Text = ""    
  2224.            
  2225.             local function lerp(a,b,c)
  2226.                 return a+(b-a)*c  
  2227.             end
  2228.             for i = 0, 1, .05 do
  2229.                 --fade out
  2230.                 spawn(function()
  2231.                     while wait() do
  2232.                         if rs_event == 0 then
  2233.                             for i = 0, 1, .05 do
  2234.                                 local newTrans = lerp(0.5, 1, i)
  2235.                                 screenpaids.Transparency = newTrans
  2236.                                 rs:wait()
  2237.                             end
  2238.                             iscreen:Destroy()
  2239.                             rs_debounce = false
  2240.                         end
  2241.                     end
  2242.                 end)
  2243.                 --fade in
  2244.                 local newTrans = lerp(1, 0.5, i)
  2245.                 screenpaids.Transparency = newTrans
  2246.                 rs:wait()
  2247.             end
  2248.            
  2249.             spawn(function()
  2250.                 while true do
  2251.                     if math.random(1) == 1 then
  2252.                         if TypingSub < #Code then
  2253.                             TypingSub = TypingSub + 1
  2254.                             TextC.Text = TextC.Text..Code:sub(TypingSub, TypingSub)
  2255.                             local nl = TextC.Text:find("\n")
  2256.                             if nl and #TextC.Text > 400 then
  2257.                                 TextC.Text = TextC.Text:sub(nl + 1)
  2258.                             end
  2259.                         else
  2260.                             TypingSub = 1
  2261.                         end
  2262.                     end
  2263.                     rs:wait()
  2264.                 end
  2265.             end)
  2266.            
  2267.         end
  2268.     end)
  2269. end
  2270.  
  2271. function load_cybereffect()
  2272.     spawn(function()
  2273.         local function lerp(a,b,c)
  2274.             return a+(b-a)*c  
  2275.         end
  2276.         local function rndRange(rng)
  2277.             return math.random(-rng*1000,rng*1000)/1000
  2278.         end
  2279.         local magik = Instance.new("Part", Torso)
  2280.         magik.Anchored = true
  2281.         magik.Locked = true
  2282.         magik.Material = "Neon"
  2283.         magik.FormFactor = "Custom"
  2284.         magik.Size = Vector3.new(1.2, 1.2, 1.2)
  2285.         magik.TopSurface = "Smooth"
  2286.         magik.BottomSurface = "Smooth"
  2287.         magik.Transparency = 0
  2288.         magik.CanCollide = false
  2289.                
  2290.         magik.BrickColor = BrickColor.new(0,125,255)
  2291.            
  2292.         local mr = math.rad
  2293.         local rnx,rny,rnz = mr(rndRange(20)),mr(rndRange(20)),mr(rndRange(20))
  2294.         local cf = Torso.CFrame * CFrame.new(math.random(-5,5), -.5, math.random(-5,5)) * CFrame.Angles(rnx,rny,rnz)
  2295.         magik.CFrame = cf
  2296.         for i = 0, 1, .025 do
  2297.             local newTrans = lerp(0.5, 1, i)
  2298.             local ns = lerp(1,1.2,i)
  2299.             magik.Transparency = newTrans
  2300.             magik.Size = Vector3.new(ns,ns+math.random(5,7),ns)
  2301.             magik.CFrame = cf
  2302.             rs:wait()
  2303.         end
  2304.         magik:Destroy()
  2305.         wait()
  2306.     end)
  2307. end
  2308.  
  2309. spawn(function()
  2310.     while wait(0.1) do
  2311.         load_normaleffect()
  2312.     end
  2313. end)
  2314.  
  2315. spawn(function()
  2316.     while wait(0.1) do
  2317.         if Mode == "Cyber" then
  2318.             load_cybereffect()
  2319.         end
  2320.     end
  2321. end)
  2322.  
  2323. local Create_Effects = function(shape,color,changeto)
  2324.     local function lerp(a,b,c)
  2325.         return a+(b-a)*c  
  2326.     end
  2327.     local eff = new(Char,0,0,true,false,color,"Effect",Vector3.new(1,1,1),"Torso")
  2328.     eff.Shape = shape
  2329.     coroutine.resume(coroutine.create(function()
  2330.     for i = 0, 1, .05 do
  2331.         local ns = lerp(1,12,i)
  2332.         eff.Transparency = i
  2333.         eff.Size = Vector3.new(ns,ns,ns)
  2334.         rs:wait()
  2335.     end
  2336.     eff:Destroy()
  2337.     end))  
  2338. end
  2339.  
  2340. --------------------------------------
  2341. --                                  --
  2342. --          Get_Key&Mouse;          --
  2343. --                                  --
  2344. --------------------------------------
  2345.  
  2346. local click = {false,false,false}
  2347. local debounce = {false}
  2348.        
  2349. Mouse.KeyDown:connect(function(key)
  2350.     --fly function
  2351.     keysDown[key] = true
  2352.     if key == "f" then
  2353.         flyToggled = not flyToggled
  2354.     if not flyToggled then
  2355.         stanceToggle = "Normal"
  2356.         floatBP.Parent = nil
  2357.         flyBV.Parent = nil
  2358.         turnBG.Parent = nil
  2359.         HumanoidRootPart.Velocity = Vector3.new(0,0,0)
  2360.         Humanoid.PlatformStand = false
  2361.     end
  2362.     end
  2363.     --gui game function
  2364.     if key == "g" then
  2365.         animpose = "ChooseMinigame"
  2366.         GuiGameChooser()
  2367.     end
  2368.     --q run function
  2369.     if key == "q" then
  2370.         if click[3] == false then
  2371.             if debounce[1] == false then
  2372.                 Humanoid.WalkSpeed = 33
  2373.                 click[3] = true
  2374.                 return
  2375.             end
  2376.         end
  2377.         if click[3] == true then
  2378.             if debounce[1] == false then
  2379.                 Humanoid.WalkSpeed = 16
  2380.                 click[3] = false
  2381.                 return
  2382.             end
  2383.         end
  2384.     end
  2385.     --bring function  
  2386.     if key == "z" then
  2387.         HumanoidRootPart.CFrame = Mouse.Hit * CFrame.new(0, 2.8, 0)
  2388.         local Sbring = Sound(idSounds[1],"BringSound!",5,false,Head,true,1,true)
  2389.         Create_Effects("Ball",SameColorMode,Vector3.new(1,1,1))
  2390.     end
  2391.     --teleport player function
  2392.     if key == "t" then
  2393.         local player = game.Players
  2394.         local pos = player.LocalPlayer.Character.Torso.Position
  2395.         local getplayer = player:GetPlayers()
  2396.         for i = 1, #getplayer do
  2397.             getplayer[i].Character:MoveTo(Vector3.new(pos.X,pos.Y,pos.Z))
  2398.         end
  2399.     end
  2400.     --map function
  2401.     if key == "m" then
  2402.         MapChooserGui()
  2403.     end
  2404.     --clear obj event function
  2405.     if key == "c" then
  2406.         ClearObjEvent()
  2407.     end
  2408.     --move model function
  2409.     if key == "l" then
  2410.         if click[2] == false then
  2411.             Mode = "Cyber"
  2412.             load_overheadtext("Cyber",Color3.fromRGB(9,116,197))
  2413.             --ChangeSoundID = 366903926
  2414.             ChangeSoundID = idSounds[7]
  2415.             Humanoid.WalkSpeed = 50
  2416.             debounce[1] = true
  2417.             click[2] = true
  2418.             return
  2419.         end
  2420.         if click[2] == true then
  2421.             Mode = "Normal"
  2422.             load_overheadtext("Creator",Color3.fromRGB(255,255,255))
  2423.             ChangeSoundID = idSounds[4]
  2424.             Humanoid.WalkSpeed = 16
  2425.             debounce[1] = false
  2426.             click[2] = false
  2427.             return
  2428.         end
  2429.     end
  2430.     --minigame gui function
  2431.     if key == "/" then
  2432.         Message("Welcome to minigame!",2)
  2433.         --GuiGameChooser()
  2434.     end
  2435. end)
  2436.  
  2437. Mouse.KeyUp:connect(function(key)
  2438.     keysDown[key] = nil
  2439. end)
  2440.  
  2441. --------------------------------------
  2442. --
  2443. --              Others;
  2444. --
  2445. --------------------------------------
  2446.  
  2447. warn([[
  2448. Minigame-Script v1.0 Loaded
  2449.     Made by basbas1234
  2450.    
  2451.     KeyBoard-Control;
  2452.     Press 'g' to create events
  2453.     Press 'm' to choose/create map
  2454.     Press 'l' to change mode
  2455.     Press 'q' to run
  2456.    
  2457.     Fixed;
  2458.     Search_System
  2459.     Debounce_Clicked
  2460.     Make_Auto Table.insert Events
  2461.    
  2462.     Enjoy My Script
  2463. ]])
  2464.  
  2465. GetPototype = {
  2466.     1,
  2467.     2,
  2468.     3,
  2469.     4,
  2470.     5,
  2471.     6,
  2472.     7,
  2473.     8,
  2474.     9,
  2475.     0,
  2476.     "a",
  2477.     "b",
  2478.     "c",
  2479.     "d",
  2480.     "f",
  2481.     "g",
  2482.     "h",
  2483.     "i",
  2484.     ""..GetPototype[1],
  2485.     "!",
  2486.     vt = function ()
  2487.        
  2488.     end
  2489. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement