Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local rs = game:GetService("RunService")
- local uis = game:GetService("UserInputService")
- local cas = game:GetService("ContextActionService")
- local cs = game:GetService("ContentProvider")
- local debris = game:GetService("Debris")
- local lighting = game:GetService("Lighting")
- local rem = game.ReplicatedStorage:WaitForChild("Remote")
- local remScripts = game.ReplicatedStorage.Scripts
- local masterControl = require(script.Parent:WaitForChild("PlayerModule").ControlModule)
- game.StarterGui:SetCoreGuiEnabled(1, false)
- game.StarterGui:SetCoreGuiEnabled(2, false)
- TimesSurvived = 0
- local passKey
- repeat
- passKey = rem.ReqPasskey:InvokeServer()
- if not passKey then
- wait(2)
- end
- until passKey
- rem.ReqPasskey:Destroy()
- local player = game.Players.LocalPlayer
- local cam = game.Workspace.CurrentCamera
- local camWater, char, hum, humRtPt, humHead, depthVel, oldPos
- --print("Fetching playerData/itemData")
- local playerData, itemData
- repeat
- playerData, itemData = rem.ReqItemData:InvokeServer(-passKey, player, true)
- if not playerData then
- wait(2)
- end
- until playerData and itemData
- --print("Should be good:", tostring(playerData), tostring(itemData))
- local gui = player.PlayerGui:WaitForChild("GameGui")
- local minimalGui = player.PlayerGui:WaitForChild("MinimalGui")
- local hud = gui:WaitForChild("HUD")
- local summary = gui:WaitForChild("Summary")
- local notif = gui:WaitForChild("Notification")
- local shop = gui:WaitForChild("Shop")
- local shopState = "main"
- local shopSort = "all"
- local shopList = shop.Items.Holder
- local currentShopItem
- local sortButtons = {
- {
- shop:WaitForChild("ViewAll"),
- "all"
- },
- {
- shop:WaitForChild("ViewOwned"),
- "owned"
- }
- }
- local howToPage = 1
- local maxHowToPage = 3
- local alertList = {}
- local stayAlertList = {}
- local menuEnabled = true
- local guiAirState = "air"
- local shopStandTouch = tick()
- local showRebirth = false
- local notifyFunc = function()
- --print("No function set for notifyFunc")
- end
- local notifyQueue = {}
- local spectate = gui:WaitForChild("Spectate")
- local options = gui:WaitForChild("Options")
- local loading = gui:WaitForChild("Loading")
- local alerts = hud:WaitForChild("Alerts")
- local guiMenus = {
- {
- shop,
- hud:WaitForChild("Shop")
- },
- {
- spectate,
- hud:WaitForChild("Spectate"),
- spectate:WaitForChild("Close")
- },
- {
- summary,
- hud:WaitForChild("Summary"),
- summary:WaitForChild("Close")
- },
- {
- options,
- hud:WaitForChild("Options"),
- options:WaitForChild("Close")
- },
- }
- local sumDif = {
- "Easy",
- "Normal",
- "Hard",
- "Insane",
- "Crazy",
- }
- local difColors = {
- Color3.fromRGB(85, 255, 127),
- Color3.fromRGB(255, 255, 127),
- Color3.fromRGB(255, 85, 127),
- Color3.fromRGB(170, 85, 255),
- Color3.fromRGB(255, 165, 0),
- }
- local menuOpen, screenFadeState, iFade
- local lobbyDetail = workspace:WaitForChild("Lobby"):WaitForChild("Detail")
- local gameState, multiMap
- local LobbyWaters = workspace:WaitForChild("Lobby"):WaitForChild("Waters")
- local swimmables = workspace:WaitForChild("Lobby"):WaitForChild("Waters"):GetDescendants()
- local multiSurvive, multiLoaded, exitChecking, neededAssets
- local charState = 5
- local maxTankAir = 300
- local tankAir = 0
- local maxBasicAir = 1
- local basicAir = maxBasicAir
- local tempAir = 10
- local airDrainRate = 8
- local airRegenRate = 16
- local lowestAir = basicAir
- local lastSurfaced = tick()
- local lastAcid = tick()
- local swimTipped = 3 < playerData.stats.level
- local lobbyBgm = game.ReplicatedStorage.LobbyMusic.Value
- local bgm = Instance.new("Sound")
- bgm.Looped = true
- bgm.Volume = 0
- bgm.Name = "BGM"
- bgm.Parent = player
- local riseVal = 0
- local wParticles = script.WaterParticles:Clone()
- local wParticlesP = Instance.new("Part")
- wParticlesP.Size = Vector3.new(30, 30, 30)
- wParticlesP.Anchored = true
- wParticlesP.CanCollide = false
- wParticlesP.Transparency = 1
- wParticlesP.Parent = game.Workspace
- local waitingCamFrame = {
- CFrame.new(-25.5151863, -126.479607, 42.9704247, -1, 1.07924629E-4, -3.81470047E-4, 7.27595848E-12, 0.962231636, 0.272232294, 3.96443123E-4, 0.272232294, -0.962231457),
- CFrame.new(-25.5, -130.549866, 63.149971, -1, 0, 0, 0, 1, 0, 0, 0, -1),
- CFrame.new(-20.9070778, -129.621719, 45.3437462, -0.879642725, -0.115875036, 0.461304396, 0, 0.969870448, 0.243621677, -0.475635171, 0.214300036, -0.853139341),
- CFrame.new(-19.5606194, -129.514816, -16.9193382, -0.889419019, -0.0880693123, 0.44852829, 0, 0.981263161, 0.192672729, -0.457092792, 0.171366796, -0.872754097)
- }
- local chosenCamFrame = 1
- local lastInputType, mapTimer
- local isVIP = rem.ReqVIPStatus:InvokeServer(-passKey)
- IsAdmin = true
- local debugAir
- local BGMmuted = false
- local AurasDisabled = false
- local KEYBINDS = {
- EMOTE = Enum.KeyCode.E,
- SWIMDIVE = Enum.KeyCode.LeftShift,
- SWIMJUMP = Enum.KeyCode.Space
- }
- local NOBINDS = {
- Enum.KeyCode.W,
- Enum.KeyCode.A,
- Enum.KeyCode.S,
- Enum.KeyCode.D,
- Enum.KeyCode.Escape,
- Enum.KeyCode.Unknown
- }
- local touchJump
- function newStayAlert(msg, color, add)
- if add == true then
- local minAlert = Instance.new("TextLabel")
- minAlert.ZIndex = 3
- minAlert.Text = msg
- minAlert.TextColor3 = color or Color3.new(1, 1, 1)
- minAlert.TextScaled = true
- minAlert.Font = "Highway"
- minAlert.TextStrokeTransparency = 0
- minAlert.BackgroundTransparency = 1
- minAlert.Size = UDim2.new(1, 0, -0.25, 0)
- minAlert.Position = UDim2.new(0, 0, 1, 0)
- local alert = Instance.new("TextLabel")
- delay(0, function()
- alert.ZIndex = 3
- alert.Text = msg
- alert.TextColor3 = color or Color3.new(1, 1, 1)
- alert.TextScaled = true
- alert.Font = "Highway"
- alert.TextStrokeTransparency = 0
- alert.BackgroundTransparency = 1
- alert.Size = UDim2.new(1, 0, 1, 0)
- alert.Position = UDim2.new(0, 0, 0,1- alerts.AbsoluteSize.Y * 0.5)
- alert.Parent = alerts
- table.insert(stayAlertList, 1, alert)
- for i = 1, -0.1, -0.1 do
- alert.TextTransparency = i
- alert.TextStrokeTransparency = i + 0.1
- wait()
- end
- end)
- return alert, minAlert
- else
- handleAlert(1, stayAlertList[1], true)
- end
- end
- function closeNotif()
- notif.Visible = false
- function notifyFunc()
- --print("Blank")
- end
- if #notifyQueue > 0 then
- local qNotif = notifyQueue[1]
- newNotification(qNotif.info, qNotif.title, qNotif.func)
- table.remove(notifyQueue, 1)
- end
- newSound(1524549907)
- end
- function newNotification(newInfo, newTitle, actionFunc)
- if notif.Visible == true then
- table.insert(notifyQueue, {
- info = newInfo,
- title = newTitle,
- func = actionFunc
- })
- else
- newSound(1523860403)
- local choice = actionFunc and true or false
- notif.Visible = true
- notif.Window.Content.Info.Text = newInfo
- notif.Window.Title.Text = newTitle or "Notification"
- notif.Window.Choices.Visible = choice
- notif.Window.Confirm.Visible = not choice
- notifyFunc = actionFunc or function()
- --print("Blank")
- end
- if choice then
- game:GetService("GuiService").SelectedObject = notif.Window.Choices.No
- else
- game:GetService("GuiService").SelectedObject = notif.Window.Confirm
- end
- notif.Window.Position = UDim2.new(0.5, 0, 0.7, 0)
- notif.Window:TweenPosition(UDim2.new(0.5, 0, 0.5, 0), "Out", "Elastic", 0.55, true)
- end
- end
- function replaceKeybind(bindToReplace, newKey, option, override)
- local canReplace = true
- if not override then
- for i, c in pairs(KEYBINDS) do
- if KEYBINDS[i] == newKey then
- canReplace = false
- end
- end
- for i, c in pairs(NOBINDS) do
- if c == newKey then
- canReplace = false
- end
- end
- end
- KEYBINDS[bindToReplace] = canReplace and newKey or KEYBINDS[bindToReplace]
- if option then
- option.Notch.Info.Text = string.sub(tostring(KEYBINDS[bindToReplace]), 14)
- do
- local feedbackColor = canReplace and Color3.fromRGB(39, 174, 96) or Color3.fromRGB(192, 57, 43)
- option.Notch.BGf.BackgroundColor3 = feedbackColor
- spawn(function()
- wait(0.15)
- if option.Notch.BGf.BackgroundColor3 == feedbackColor then
- option.Notch.BGf.BackgroundColor3 = Color3.fromRGB(41, 128, 185)
- end
- end)
- end
- end
- return canReplace
- end
- function inPart(pos, item)
- return require(remScripts.FE2Library).inPart(pos, item, swimmables)
- end
- function screenFade(dir, t, state, load, resume)
- delay(0, function()
- screenFadeState = dir
- local begin = dir == "In" and 1 or 0
- local finish = math.abs(begin - 1)
- local duration = (finish - begin) * (t / 30)
- game.Lighting.Fade_Blur.Enabled = true
- game.Lighting.Fade_ColorCorrection.Enabled = true
- loading.Visible = load or loading.Visible
- if game.Lighting.Fade_ColorCorrection.Brightness ~= -finish then
- for i = resume and iFade or begin, finish, duration do
- if screenFadeState == dir then
- iFade = i
- game.Lighting.Fade_Blur.Size = i * 100
- game.Lighting.Fade_ColorCorrection.Brightness = -(i * i)
- if loading.Visible then
- loading.Info.TextTransparency = 1 - i
- loading.Info.TextStrokeTransparency = 1 - (i - 0.1)
- loading.Swirl.ImageTransparency = 1 - i
- end
- wait()
- end
- end
- end
- loading.Visible = state and load
- game.Lighting.Fade_Blur.Enabled = state
- game.Lighting.Fade_ColorCorrection.Enabled = state
- end)
- end
- function updBgm(id)
- delay(0, function()
- local BGMchanging = true
- local oldId = bgm.SoundId
- local newBGM
- if id ~= 0 then
- newBGM = Instance.new("Sound")
- newBGM.SoundId = "rbxassetid://" .. id
- newBGM.Looped = true
- newBGM.Volume = 0
- newBGM.Name = "BGM"
- newBGM.Parent = player
- end
- while 0 < bgm.Volume and wait() do
- bgm.Volume = bgm.Volume - 0.03333333333333333
- end
- if bgm.SoundId == oldId then
- bgm:Stop()
- end
- if id ~= 0 then
- bgm:Destroy()
- newBGM.Parent = script
- bgm = newBGM
- while not bgm.IsLoaded do
- wait()
- end
- bgm:Play()
- bgm.Volume = 0
- bgm.SoundGroup = camWater and game.SoundService.Underwater or nil
- while bgm.SoundId == newBGM.SoundId and bgm.Volume < 1 and not BGMmuted and wait() do
- bgm.Volume = bgm.Volume + 0.03333333333333333
- end
- end
- end)
- end
- function updLighting(newLighting)
- local propsToFind = {
- "Ambient",
- "Brightness",
- "ColorShift_Bottom",
- "ColorShift_Top",
- "OutdoorAmbient",
- "TimeOfDay",
- "FogColor",
- "FogEnd",
- "FogStart",
- }
- local new = {
- Ambient = Color3.fromRGB(127, 127, 127),
- Brightness = 1,
- OutdoorAmbient = Color3.fromRGB(127, 127, 127),
- ColorShift_Bottom = Color3.new(),
- ColorShift_Top = Color3.new(),
- TimeOfDay = "14:00:00",
- FogColor = Color3.fromRGB(191, 191, 191),
- FogEnd = 100000,
- FogStart = 0,
- }
- if newLighting ~= nil and newLighting:IsA("Folder") then
- for _, c in pairs(newLighting:GetChildren()) do
- for _, a in pairs(propsToFind) do
- if c.Name == a then
- new[c.Name] = c.Value
- break
- end
- end
- end
- end
- for _, a in pairs(propsToFind) do
- lighting[a] = new[a]
- end
- end
- function countAssets(item)
- local newAssets = item:GetChildren()
- local count = #newAssets
- for _, c in pairs(newAssets) do
- count = count + countAssets(c)
- end
- return count
- end
- function updMultiMap(item)
- --print(item.Name)
- if item.Name == "NewMap" then
- multiMap = item
- repeat
- wait()
- until item.Name == "Map"
- end
- if item.Name == "Map" then
- multiMap = item
- swimmables = LobbyWaters:GetDescendants()
- findWater(multiMap)
- if gameState == "ingame" or gameState == "loading" then
- if gameState == "ingame" or gameState == "loading" then
- initiateMultiMap(multiMap)
- end
- multiMap:WaitForChild("Settings")
- updLighting(multiMap.Settings.Lighting)
- end
- end
- end
- game.Workspace.Multiplayer.ChildAdded:connect(updMultiMap)
- function curWaitCam()
- local waitFrame = waitingCamFrame[chosenCamFrame] * CFrame.Angles(math.sin(tick() * 1.666) * 0.01, math.sin(tick()) * 0.04, math.sin(tick() * 0.1) * 0.01) * CFrame.new(math.sin(tick() * 1), math.sin(tick() * 1.666) * 0.02, 0)
- return waitFrame
- end
- function updGameState(gState, assets)
- local oldGameState = gameState
- gameState = gState
- workspace.Lobby.PlayHere.SurfaceGui.Enabled = gameState ~= "waiting"
- workspace.Lobby.GameInfo.SurfaceGui.AlwaysOnTop = gameState == "waiting"
- hud.MenuToggle.Stats.Visible = gameState == nil or gameState == "waiting" or gameState == "loading" and oldGameState == "waiting"
- hud.MenuToggle.Air.Visible = gameState == "ingame" or gameState == "loading" and oldGameState == "ingame"
- if gameState == "waiting" then
- cam.CameraType = "Scriptable"
- chosenCamFrame = math.random(3, #waitingCamFrame)
- spawn(function()
- local oldCamFrame = cam.CFrame
- local setTime = tick()
- repeat
- if tick() <= setTime + 0.5 then
- cam.CFrame = oldCamFrame:lerp(curWaitCam(), math.sin((tick() - setTime) * 2 * (math.pi / 2)))
- elseif cam.CameraSubject == hum then
- cam.CFrame = curWaitCam()
- end
- rs.RenderStepped:wait()
- until gameState ~= "loading" and gameState ~= "waiting"
- end)
- elseif gameState ~= "loading" then
- cam.CameraType = "Custom"
- end
- if gameState == "loading" and assets then
- screenFade("Out", 2, true, true)
- loading.Info.Text = "Loading Map..."
- loading.Swirl.Rotation = 0
- repeat
- wait()
- until multiMap
- while wait(0.1) do
- local count = countAssets(multiMap)
- loading.Info.Text = "Loading Map (" .. tostring(math.floor(count / assets * 100)) .. "%)"
- --print(count, assets)
- if assets <= count then
- break
- end
- end
- if isLowPerformance then
- local mapObjs = multiMap:GetDescendants()
- for _, c in next, mapObjs, nil do
- if c.Name == "_Detail" then
- c:Destroy()
- elseif c:IsA("BasePart") then
- c.Material = Enum.Material.SmoothPlastic
- elseif c:IsA("ParticleEmitter") or c:IsA("Smoke") or c:IsA("Fire") or c:IsA("Sparkles") then
- c.Enabled = false
- end
- end
- end
- rem.LoadedMap:FireServer(-passKey)
- loading.Info.Text = "Waiting for Server"
- end
- if gameState == "ingame" then
- lobbyDetail.Parent = nil
- if hum and cam.CameraSubject ~= hum then
- cam.CameraSubject = hum
- end
- tankAir = 0
- tempAir = 0
- basicAir = maxBasicAir
- lowestAir = basicAir
- hud.MenuToggle.Air.BasicBar.Position = UDim2.new(0.025, 0, 0.95, 0)
- hud.MenuToggle.Air.AirText.TextColor3 = Color3.new(1, 1, 1)
- if oldGameState == "loading" then
- loading.Info.Text = "Ready!"
- screenFade("In", 2, false, true, true)
- end
- multiSurvive = nil
- end
- if gameState == nil then
- if oldGameState == "ingame" then
- toggleMarkerVisibility(false)
- end
- lobbyDetail.Parent = workspace.Lobby
- end
- end
- function switchAir(airType)
- if airType == "tank" then
- hud.MenuToggle.Air.BasicBar.Position = UDim2.new(0.025, 0, 0.95, 0)
- hud.MenuToggle.Air.BasicBar:TweenSize(UDim2.new(0.95, 0, -0.1, 0), "Out", "Sine", 0.3, true)
- hud.MenuToggle.Air.TankBar:TweenSize(UDim2.new(0.9, 0, 0.25, 1), "Out", "Sine", 0.3, true)
- hud.MenuToggle.Air.AirText.TextColor3 = Color3.new(1, 1, 1)
- guiAirState = "tank"
- else
- hud.MenuToggle.Air.TankBar:TweenSize(UDim2.new(0.9, 0, 0.1, 1), "Out", "Sine", 0.3, true)
- hud.MenuToggle.Air.BasicBar:TweenSize(UDim2.new(0.95, 0, -0.25, 0), "Out", "Sine", 0.3, true)
- guiAirState = "air"
- end
- script.Air:Play()
- hud.MenuToggle.Air.Position = UDim2.new()
- end
- function takeAir(amount)
- local amt = amount
- if tankAir > 0 then
- tankAir = tankAir - amt
- if tankAir < 0 then
- amt = math.abs(tankAir)
- else
- amt = 0
- end
- end
- basicAir = basicAir - amt
- if basicAir < 0 then
- basicAir = 0
- end
- end
- function CharAdded(newChar)
- TimesSurvived = 0
- char = newChar
- hum = char:WaitForChild("Humanoid")
- humRtPt = char:WaitForChild("HumanoidRootPart")
- humHead = char:WaitForChild("Head")
- basicAir = maxBasicAir
- tankAir = 0
- switchAir()
- depthVel = Instance.new("BodyVelocity", humRtPt)
- depthVel.Name = "SwimVel"
- depthVel.MaxForce = Vector3.new(0, 0, 0)
- depthVel.P = 8000
- depthVel.Velocity = Vector3.new(1, 0, 1)
- humRtPt.Touched:connect(function(hit)
- hum.WalkSpeed = 21
- if hit.Parent and hit.Parent.Name == "AirTank" and hit.Parent:FindFirstChild("Hitbox") then
- local par = hit.Parent
- par.Hitbox:Destroy()
- if tankAir <= 0 then
- switchAir("tank")
- end
- tankAir = maxTankAir
- local oldScale = par.Outline.Mesh.Scale
- local oldTransparency = par.Outline.Transparency
- for i = 0, 1, 0.03333333333333333 do
- par.Outline.Mesh.Scale = oldScale + Vector3.new(i, i, i)
- par.Outline.Transparency = oldTransparency + i * 0.6
- rs.RenderStepped:wait()
- end
- par:Destroy()
- end
- end)
- hum.Touched:connect(function(pt)
- if pt.Parent ~= nil and hum.Health > 0 and pt.Parent.Name == "ShopTriggers" and shopState ~= pt.Name and tick() - shopStandTouch > 1.5 then
- changeMenu(1)
- updShop(pt.Name)
- end
- if pt.Name == "BGMTrigger" and bgm.SoundId ~= "rbxassetid://" .. pt.BGM.Value then
- updBgm(pt.BGM.Value)
- end
- end)
- hum.Died:connect(function()
- local humCheck = hum
- cas:UnbindAction("swimDive")
- cas:UnbindAction("swimJump")
- charState = 0
- updGameState(nil)
- loading.Visible = false
- local PhysList = {}
- for _, c in pairs(newChar:GetChildren()) do
- if c:IsA("BasePart") then
- local BodyPos = Instance.new("BodyPosition", c)
- BodyPos.P = 10000
- BodyPos.MaxForce = Vector3.new()
- table.insert(PhysList, BodyPos)
- end
- end
- spawn(function()
- local maxTime = tick() + 5
- while maxTime > tick() and rs.RenderStepped:wait() do
- for _, bodypos in pairs(PhysList) do
- if bodypos.Parent then
- local force = inPart(bodypos.Parent.Position, swimmables) and 1100 or 0
- bodypos.Position = bodypos.Parent.Position
- bodypos.MaxForce = Vector3.new(force * 0.05, force, force * 0.05)
- else
- bodypos:Destroy()
- end
- end
- end
- end)
- wait(1.9)
- if hum == humCheck then
- updBgm(0)
- screenFade("Out", 1, true, false)
- end
- end)
- hum.Seated:connect(function(val)
- if val == true then
- hum.Health = 0
- newAlert(">:(", Color3.new(1, 0, 0))
- end
- end)
- newChar.ChildAdded:connect(function(item)
- if item:IsA("Accessory") then
- item:WaitForChild("Handle")
- item.Handle.CustomPhysicalProperties = PhysicalProperties.new(0, 0, 0, 0, 0)
- end
- if item.Name == "LocalEventScript" and item:IsA("LocalScript") then
- item.Disabled = false
- end
- end)
- updLighting()
- updBgm(lobbyBgm)
- screenFade("In", 1, false)
- spawn(function()
- local setTime = tick()
- repeat
- hum.CameraOffset = Vector3.new(0, -4 + math.sin((tick() - setTime) / 1.5 * (math.pi / 2)) * 4, 0)
- game:GetService("RunService").Heartbeat:wait()
- until tick() - setTime > 1.5
- end)
- if uis.TouchEnabled then
- repeat
- wait(1)
- until player.PlayerGui:findFirstChild("JumpButton", true)
- touchJump = player.PlayerGui:findFirstChild("JumpButton", true)
- if touchJump then
- touchJump.InputBegan:connect(function(ioObj)
- swimJump("Touch", ioObj.UserInputState)
- end)
- touchJump.InputEnded:connect(function(ioObj)
- swimJump("Touch", ioObj.UserInputState)
- end)
- end
- end
- end
- function findWater(item)
- for i, c in pairs(item:GetChildren()) do
- if string.find(c.Name, "_Water") then
- table.insert(swimmables, c)
- if not c:findFirstChild("BlockMesh") then
- local mesh = Instance.new("BlockMesh")
- mesh.Scale = Vector3.new(1, 0, 1)
- mesh.Offset = Vector3.new(0, c.Size.Y * 0.5, 0)
- mesh.Parent = c
- end
- else
- findWater(c)
- end
- end
- end
- function toggleMarkerVisibility(state)
- if multiMap then
- for _, c in next, multiMap:GetDescendants() do
- if c:IsA("BillboardGui") then
- c.Enabled = state
- end
- end
- end
- end
- function initiateMultiMap(item)
- screenFade("Out", 2, true, true)
- local newBgm = item.Settings.BGM
- if newBgm then
- updBgm(newBgm.Value)
- end
- toggleMarkerVisibility(true)
- riseList = {}
- riseVal = 30
- if multiMap:findFirstChild("Intro") then
- table.insert(riseList, multiMap.Intro)
- end
- for _, i in pairs(riseList) do
- i:TranslateBy(Vector3.new(0, -riseVal, 0))
- end
- end
- function doEmote(action, uiState)
- if uiState == Enum.UserInputState.Begin then
- local localKey = KEYBINDS.EMOTE
- if char and char:FindFirstChild("Animate") then
- char.Animate.EmoteFire:Fire()
- end
- end
- end
- local tweenInfoCooldown = TweenInfo.new(
- 5, -- Time
- Enum.EasingStyle.Linear, -- EasingStyle
- Enum.EasingDirection.Out, -- EasingDirection
- 0, -- RepeatCount (when less than zero the tween will loop indefinitely)
- false, -- Reverses (tween will reverse once reaching it's goal)
- 0 -- DelayTime
- )
- function swimJump(action, uiState)
- if depthVel and hum and charState == 1 then
- if uiState == Enum.UserInputState.Begin then
- depthVel.Velocity = Vector3.new(0, hum.WalkSpeed, 0)
- elseif uiState == Enum.UserInputState.End and 0 < depthVel.Velocity.Y then
- depthVel.Velocity = Vector3.new(0, 0, 0)
- end
- end
- end
- function swimDive(action, uiState)
- if depthVel and hum and charState == 1 then
- if uiState == Enum.UserInputState.Begin then
- depthVel.Velocity = Vector3.new(0, -hum.WalkSpeed, 0)
- elseif uiState == Enum.UserInputState.End and 0 > depthVel.Velocity.Y then
- depthVel.Velocity = Vector3.new(0, 0, 0)
- end
- end
- end
- function bindSwimActions()
- if charState == 1 then
- cas:BindAction("swimJump", swimJump, true, KEYBINDS.SWIMJUMP)
- cas:BindAction("swimDive", swimDive, true, KEYBINDS.SWIMDIVE)
- cas:SetTitle("swimDive", "Dive")
- cas:SetTitle("swimJump", "Swim")
- if touchJump then
- local dive = cas:GetButton("swimDive")
- dive.Size = UDim2.new(0, touchJump.AbsoluteSize.X, 0, touchJump.AbsoluteSize.Y)
- dive.Position = UDim2.new(0, touchJump.AbsolutePosition.X - dive.Parent.AbsolutePosition.X, 0, touchJump.AbsolutePosition.Y - dive.Parent.AbsolutePosition.Y - dive.AbsoluteSize.Y * 0.75)
- local title = dive:findFirstChild("ActionTitle")
- if title then
- title.Size = UDim2.new(0.75, 0, 0.75, 0)
- title.Position = UDim2.new(0.125, 0, 0.125, 0)
- title.TextXAlignment = "Center"
- title.TextYAlignment = "Center"
- title.TextScaled = true
- end
- end
- if touchJump then
- local jump = cas:GetButton("swimJump")
- jump.Size = UDim2.new(0, touchJump.AbsoluteSize.X, 0, touchJump.AbsoluteSize.Y)
- jump.Position = UDim2.new(0, touchJump.AbsolutePosition.X - jump.Parent.AbsolutePosition.X, 0, touchJump.AbsolutePosition.Y - jump.Parent.AbsolutePosition.Y - jump.AbsoluteSize.Y * 2.25)
- local title = jump:findFirstChild("ActionTitle")
- if title then
- title.Size = UDim2.new(0.75, 0, 0.75, 0)
- title.Position = UDim2.new(0.125, 0, 0.125, 0)
- title.TextXAlignment = "Center"
- title.TextYAlignment = "Center"
- title.TextScaled = true
- end
- end
- end
- end
- spawn(function()
- local step = 0
- while true do
- local newCam = inPart(cam.CFrame.p, swimmables)
- local newR, newG, newB
- if newCam then
- newR, newG, newB = newCam.BrickColor.r + (1 - newCam.BrickColor.r) * 0.33, newCam.BrickColor.g + (1 - newCam.BrickColor.g) * 0.33, newCam.BrickColor.b + (1 - newCam.BrickColor.b) * 0.33
- end
- if newCam ~= camWater then
- camWater = newCam
- for _, c in pairs(lighting:GetChildren()) do
- if c.Name:find("Water_") then
- c.Enabled = newCam
- end
- end
- lighting.Water_ColorCorrection.TintColor = newCam and Color3.new(newR, newG, newB) or lighting.Water_ColorCorrection.TintColor
- bgm.SoundGroup = newCam and game.SoundService.Underwater
- script.Splash_water.SoundGroup = newCam and game.SoundService.Underwater
- script.Splash_lava.SoundGroup = newCam and game.SoundService.Underwater
- script.Splash_acid.SoundGroup = newCam and game.SoundService.Underwater
- wParticles.Parent = wParticlesP
- end
- if newCam and lighting.Water_ColorCorrection.Enabled and lighting.Water_ColorCorrection.TintColor ~= Color3.new(newR, newG, newB) then
- lighting.Water_ColorCorrection.TintColor = lighting.Water_ColorCorrection.TintColor:lerp(Color3.new(newR, newG, newB), 0.05)
- end
- if camWater then
- hum.CameraOffset = Vector3.new(math.sin(tick() * 3) * 0.2, math.sin(tick() * 3.21) * 0.2, math.sin(tick() * 3.73) * 0.2)
- elseif camWater and not newCam then
- hum.CameraOffset = Vector3.new()
- end
- if newCam and cam.CameraSubject:IsA("Humanoid") and cam.CameraSubject.Torso ~= nil then
- local yLimit = 0
- wParticlesP.CFrame = CFrame.new(cam.CameraSubject.Torso.Position.X, cam.CameraSubject.Torso.Position.Y, cam.CameraSubject.Torso.Position.Z)
- end
- if riseVal ~= 0 then
- local dist = riseVal * (step * 2) + 0.015
- if riseVal < 0.05 then
- dist = riseVal
- end
- riseVal = riseVal - dist
- for _, i in pairs(riseList) do
- i:TranslateBy(Vector3.new(0, dist, 0))
- end
- end
- if humRtPt and humHead and hum then
- if 0 < hum.Health then
- if gameState == nil then
- if inPart(humRtPt.Position, game.ReplicatedStorage.WaitingRegion) then
- updGameState("waiting")
- newAlert("You will join the next round")
- rem.AddedWaiting:FireServer(-passKey)
- end
- elseif gameState == "waiting" and inPart(humRtPt.Position, game.ReplicatedStorage.WaitingRegion) == nil then
- updGameState(nil)
- rem.RemoveWaiting:FireServer(-passKey)
- newStayAlert(nil,nil,false)
- end
- if gameState == nil then
- if inPart(humRtPt.Position, workspace.Lobby.OWait) then
- local function newFunc()
- --print("test")
- end
- newNotification("This will cost 25 coins", "test", newFunc, true)
- wait(2.5)
- end
- end
- local inWater = inPart(humHead.Position, swimmables)
- local waterState = "water"
- if inWater and inWater:FindFirstChild("State") then
- waterState = inWater.State.Value
- end
- local newState = inWater and 1 or 0
- if newState ~= charState then
- charState = newState
- if char:FindFirstChild("Animate") then
- char.Animate.ToggleSwim:Fire(charState)
- end
- script["Splash_" .. waterState]:Play()
- if charState == 0 then
- lastSurfaced = tick()
- cas:UnbindAction("swimDive")
- cas:UnbindAction("swimJump")
- depthVel.MaxForce = Vector3.new(0, 8000, 0)
- depthVel.Velocity = Vector3.new(0, 50, 0)
- char.Head.Bubbles.Enabled = false
- wait(0.08)
- if depthVel.Velocity.Y == 50 then
- depthVel.MaxForce = Vector3.new(0, 0, 0)
- end
- if depthVel.Velocity.Y == 50 then
- depthVel.Velocity = Vector3.new(0, 0, 0)
- end
- elseif charState == 1 then
- if waterState == "acid" then
- takeAir(tempAir)
- tempAir = 0
- end
- depthVel.MaxForce = Vector3.new(0, 8000, 0)
- local currentInput = uis:GetKeysPressed()
- for i = 1, #currentInput do
- if currentInput[i].KeyCode == KEYBINDS.SWIMJUMP then
- depthVel.Velocity = Vector3.new(0, hum.WalkSpeed, 0)
- elseif currentInput[i].KeyCode == KEYBINDS.SWIMDIVE then
- depthVel.Velocity = Vector3.new(0, -hum.WalkSpeed, 0)
- end
- end
- char.Head.Bubbles.Enabled = true
- if not swimTipped then
- newAlert(string.sub(tostring(KEYBINDS.SWIMJUMP), 14) .. " - Swim Up | " .. string.sub(tostring(KEYBINDS.SWIMDIVE), 14) .. " - Dive")
- swimTipped = true
- end
- bindSwimActions()
- end
- end
- if multiMap and not multiSurvive then
- do
- local exitRegion = multiMap:FindFirstChild("ExitRegion", true)
- if exitRegion and inPart(humRtPt.Position, exitRegion) then
- if (humRtPt.Position - oldPos).magnitude > 300 * step then
- hum.Health = 0
- newAlert("No lol", Color3.new(1, 0, 0))
- elseif not exitChecking then
- exitChecking = true
- do
- local a1, a2 = newAlert("Checking...", Color3.new(0, 1, 0))
- local elapsedMapTime = tick() - mapTimer
- spawn(function()
- if rem.Survived:InvokeServer(player, -passKey, lowestAir, exitRegion, exitRegion.Position) then
- multiSurvive = true
- TimesSurvived = TimesSurvived+1
- for _, eb in pairs(multiMap:GetChildren()) do
- if eb.Name == "ExitBlock" then
- eb.CanCollide = true
- end
- end
- local finalTime = {
- minutes = tostring(math.floor(elapsedMapTime / 60)),
- seconds = tostring(math.floor(elapsedMapTime) - math.floor(elapsedMapTime / 60) * 60),
- ms = tostring(math.floor((elapsedMapTime - math.floor(elapsedMapTime)) * 1000))
- }
- if tonumber(finalTime.seconds) < 10 then
- finalTime.seconds = "0" .. finalTime.seconds
- end
- local surviveText = "You Survived! (" .. finalTime.minutes .. ":" .. finalTime.seconds .. "." .. finalTime.ms .. ")"
- if a1 and a2 then
- a1.Text = surviveText
- a2.Text = surviveText
- end
- elseif a1 and a2 then
- a1.Text = "Incorrect Exit"
- a2.Text = "Incorrect Exit"
- end
- if basicAir == 0 then
- hum.Health = 0
- end
- wait(0.5)
- exitChecking = false
- end)
- end
- end
- end
- local eBlocks = {}
- for _, c in pairs(multiMap:GetChildren()) do
- if c.Name == "ExitBlock" then
- table.insert(eBlocks, c)
- end
- end
- for _, b in pairs(eBlocks) do
- if inPart(humRtPt.Position, b) and (humRtPt.Position - oldPos).magnitude > 300 * step then
- hum.Health = 0
- newAlert("No lol", Color3.new(1, 0, 0))
- break
- end
- end
- end
- end
- if charState == 0 or gameState ~= "ingame" then
- if lastSurfaced < tick() - 1 then
- if basicAir < maxBasicAir then
- basicAir = basicAir + airRegenRate * step
- else
- basicAir = maxBasicAir
- end
- end
- elseif charState == 1 then
- local airDrainRate = waterState == "acid" and 30 or airDrainRate
- takeAir(airDrainRate * step)
- lowestAir = basicAir < lowestAir and basicAir or lowestAir
- if waterState == "acid" then
- lastAcid = tick()
- end
- if (not (waterState ~= "lava" or debugAir) or basicAir <= 0) and not multiSurvive and not exitChecking then
- hum.Health = 0
- newAlert("You have Drowned!", Color3.new(1, 0, 0))
- end
- end
- if lastAcid < tick() - 1 and tempAir > 0 then
- tempAir = tempAir - 5 * step
- end
- local tremorScale = 1 - basicAir / maxBasicAir * 5
- if tankAir > 0 then
- hud.MenuToggle.Air.AirText.Text = "Air Tank: " .. math.floor(tankAir) .. "/" .. maxTankAir
- else
- if tremorScale >= -0.05 then
- hud.MenuToggle.Air.Position = UDim2.new(math.random(-35, 35) * 0.001 * tremorScale, 0, math.random(-35, 35) * 0.001 * tremorScale, 0)
- if waterState == "water" then
- hud.MenuToggle.Air.AirText.TextColor3 = Color3.new(1, 1 - tremorScale * 0.5, 1 - tremorScale * 0.5)
- end
- end
- if guiAirState == "tank" then
- switchAir()
- end
- hud.MenuToggle.Air.AirText.Text = "Air: " .. math.floor(basicAir) .. "/" .. maxBasicAir
- end
- if waterState == "acid" then
- if tempAir < 20 then
- tempAir = tempAir + 20 * step
- end
- hud.MenuToggle.Air.AirText.Text = "!CAUTION: ACID!"
- hud.MenuToggle.Air.AirText.TextColor3 = Color3.new(1, 0, 0)
- elseif hud.MenuToggle.Air.AirText.TextColor3 == Color3.new(1, 0, 0) then
- hud.MenuToggle.Air.AirText.TextColor3 = Color3.new(1, 1, 1)
- end
- hud.MenuToggle.Air.TankBar.Temp.Size = UDim2.new((tankAir - 0.1) / maxTankAir, 0, 1, 0)
- hud.MenuToggle.Air.TankBar.Percentage.Size = UDim2.new((tankAir - tempAir) / maxTankAir, 0, 1, 0)
- local basicTemp = 0
- if tankAir - tempAir <= 0 then
- if tankAir > 0 then
- basicTemp = math.abs(tankAir - tempAir)
- else
- basicTemp = tempAir
- end
- end
- hud.MenuToggle.Air.BasicBar.Percentage.Size = UDim2.new((basicAir - basicTemp) / maxBasicAir, 0, 1, 0)
- hud.MenuToggle.Air.BasicBar.Temp.Size = UDim2.new((basicAir - 0.1) / maxBasicAir, 0, 1, 0)
- if tempAir < 0 then
- tempAir = 0
- end
- game.Players.LocalPlayer.PlayerGui.MinimalGui.Air.TempAir.Text = tostring(math.floor(tempAir))
- game.Players.LocalPlayer.PlayerGui.MinimalGui.Air.TotalAir.Text = tostring("Air: " .. math.floor(basicAir) .. "/" .. maxBasicAir .. [[
- Tank: ]] .. math.floor(tankAir) .. "/" .. maxTankAir)
- end
- oldPos = humRtPt.Position
- end
- if loading.Visible then
- loading.Swirl.Rotation = loading.Swirl.Rotation + 5
- end
- if showRebirth and hud.MenuToggle.Stats:FindFirstChild("Rebirth") then
- local sinA = (math.sin(tick() * 2) + 1) * 0.5
- hud.MenuToggle.Stats.Rebirth.BG.Glow.BackgroundColor3 = Color3.fromRGB(0 * sinA, 170 * sinA, 255 * sinA)
- hud.MenuToggle.Stats.Rebirth.BG.Glow.A.ImageColor3 = Color3.fromRGB(0 * sinA, 170 * sinA, 255 * sinA)
- hud.MenuToggle.Stats.Rebirth.BG.Glow.B.ImageColor3 = Color3.fromRGB(0 * sinA, 170 * sinA, 255 * sinA)
- end
- step = rs.Heartbeat:wait()
- end
- end)
- rem.UpdateGameState.OnClientEvent:connect(updGameState)
- rem.UpdLoadScreen.OnClientEvent:connect(function(val)
- loading.Info.Text = val
- --print("Set loading screen text to:", val)
- end)
- rem.StartClientMapTimer.OnClientEvent:connect(function()
- mapTimer = tick()
- end)
- rem.TEST.AirToggle.OnClientEvent:connect(function()
- debugAir = not debugAir
- while debugAir do
- rs.Heartbeat:wait()
- basicAir = maxBasicAir
- end
- end)
- function handleAlert(i, c, forced)
- spawn(function()
- if c.Parent == alerts or c.Parent == alerts then
- local newPos = (i > 3 or forced) and -i or -(i - 1)
- local ease = (i > 3 or forced) and "In" or "Out"
- c:TweenPosition(UDim2.new(0, 0, newPos, 0), ease, "Sine", 0.3, true)
- if i > 3 or forced then
- table.remove(alertList, i)
- for fade = 0, 1, 0.1 do
- c.TextTransparency = fade
- c.TextStrokeTransparency = fade + 0.1
- wait()
- end
- c:Destroy()
- end
- end
- end)
- end
- function newAlert(msg, color, timer, notifBar)
- local minAlert = Instance.new("TextLabel")
- minAlert.ZIndex = 3
- minAlert.Text = msg
- minAlert.TextColor3 = color or Color3.new(1, 1, 1)
- minAlert.TextScaled = true
- minAlert.Font = "Highway"
- minAlert.TextStrokeTransparency = 0
- minAlert.BackgroundTransparency = 1
- minAlert.Size = UDim2.new(1, 0, -0.25, 0)
- minAlert.Position = UDim2.new(0, 0, 1, 0)
- for _, t in next, minimalGui.TextInfo:GetChildren() do
- t.Position = UDim2.new(0, 0, t.Position.Y.Scale - 0.25, 0)
- t.TextStrokeTransparency = 1
- t.TextTransparency = t.TextTransparency + 0.2
- end
- minAlert.Parent = minimalGui.TextInfo
- game:GetService("Debris"):AddItem(minAlert, timer or 5)
- local alert = Instance.new("TextLabel")
- delay(0, function()
- alert.ZIndex = 3
- alert.Text = msg
- alert.TextColor3 = color or Color3.new(1, 1, 1)
- alert.TextScaled = true
- alert.Font = "Highway"
- alert.TextStrokeTransparency = 0
- alert.BackgroundTransparency = 1
- alert.Size = UDim2.new(1, 0, 1, 0)
- alert.Position = UDim2.new(0, 0, 0, alerts.AbsoluteSize.Y * 0.5)
- alert.Parent = alerts
- if notifBar == true then
- local counter = Instance.new("Frame", alert)
- counter.BorderSizePixel = 0
- counter.BackgroundColor3 = color
- counter.AnchorPoint = Vector2.new(0.5, 0.5)
- counter.Position = UDim2.new(0.5)
- counter.Size = UDim2.new(1, 0, 0.1, 0)
- counter:TweenSize(UDim2.new(0, 0, 0.1, 0), "Out", "Linear", timer)
- local bg = Instance.new("ImageLabel", counter)
- bg.Image = "rbxassetid://156579757"
- bg.Size = UDim2.new(1, 0, 1, 0)
- bg.BackgroundTransparency = 1
- bg.ImageTransparency = 0.5
- end
- table.insert(alertList, 1, alert)
- for i, c in pairs(alertList) do
- handleAlert(i, c)
- end
- for i = 1, -0.1, -0.13333333333333333 do
- alert.TextTransparency = i
- alert.TextStrokeTransparency = i + 0.1
- wait()
- end
- wait(timer or 4)
- if alert and 0 >= alert.TextTransparency then
- local foundAlert = 1
- for i = 1, #alertList do
- if alertList[i] == alert then
- foundAlert = i
- break
- end
- end
- handleAlert(foundAlert, alert, true)
- end
- end)
- return alert, minAlert
- end
- function closeNotif()
- notif.Visible = false
- function notifyFunc()
- --print("Blank")
- end
- if #notifyQueue > 0 then
- local qNotif = notifyQueue[1]
- newNotification(qNotif.info, qNotif.title, qNotif.func)
- table.remove(notifyQueue, 1)
- end
- newSound(1524549907)
- end
- function newNotification(newInfo, newTitle, actionFunc, extra)
- if notif.Visible == true and extra ~= true then
- table.insert(notifyQueue, {
- info = newInfo,
- title = newTitle,
- func = actionFunc
- })
- else
- newSound(1523860403)
- local choice = actionFunc and true or false
- notif.Visible = true
- notif.Window.Content.Info.Text = newInfo
- notif.Window.Title.Text = newTitle or "Notification"
- notif.Window.Choices.Visible = choice
- notif.Window.Confirm.Visible = not choice
- notifyFunc = actionFunc or function()
- --print("Blank")
- end
- if choice then
- game:GetService("GuiService").SelectedObject = notif.Window.Choices.No
- else
- game:GetService("GuiService").SelectedObject = notif.Window.Confirm
- end
- notif.Window.Position = UDim2.new(0.5, 0, 0.7, 0)
- notif.Window:TweenPosition(UDim2.new(0.5, 0, 0.5, 0), "Out", "Elastic", 0.55, true)
- end
- end
- function newSound(ID, vol)
- local sound = Instance.new("Sound")
- sound.SoundId = "rbxassetid://" .. tostring(ID)
- sound.Parent = player
- sound.Volume = vol or 1
- sound:Play()
- debris:AddItem(sound, 15)
- end
- function showSummary(newReward)
- summary.Content.Holder:ClearAllChildren()
- --print("Displaying Summary")
- local rewards = newReward
- local y = 0
- local totalXP = 0
- for i, map in pairs(rewards) do
- local mapCard = script.SumCard:Clone()
- local mapXP = 0
- mapCard.Position = UDim2.new(0, 0, 0, summary.AbsoluteSize.Y * 0.8 * y)
- mapCard.Size = UDim2.new(1, 0, 0, summary.AbsoluteSize.Y * 0.8 * 0.075 + 1)
- mapCard.Title.Text = i .. ": " .. map[1][1] .. " [" .. sumDif[map[1][2]] .. "]"
- mapCard.BackgroundColor3 = difColors[map[1][2]]
- y = y + 0.075
- if #map > 1 then
- for s = 2, #map do
- local addXP = map[s][2]
- if map[s][3] ~= nil then
- addXP = addXP * map[s][3]
- end
- local rCard = script.SumCard:Clone()
- local colorMod = s * 0.5 == math.floor(s * 0.5) and 0.6 or 0.7
- rCard.BackgroundColor3 = Color3.new(difColors[map[1][2]].r * colorMod, difColors[map[1][2]].g * colorMod, difColors[map[1][2]].b * colorMod)
- rCard.XP.TextStrokeTransparency = 0.65
- rCard.Title.TextStrokeTransparency = 0.65
- rCard.Size = UDim2.new(1, 0, 0.05, 0)
- rCard.Position = UDim2.new(0, 0, 0, summary.AbsoluteSize.Y * 0.8 * y)
- rCard.Size = UDim2.new(1, 0, 0, summary.AbsoluteSize.Y * 0.8 * 0.05 + (map[s] ~= #map and 1 or 0))
- local tText = map[s][1]
- local xText = map[s][2] .. " XP"
- if tText == "Button" then
- tText = "Pressed " .. map[s][3] .. " Button" .. (1 < map[s][3] and "s" or "")
- xText = map[s][3] .. " * " .. map[s][2] .. " XP"
- end
- rCard.Title.Text = tText
- rCard.XP.Text = xText
- rCard.Parent = summary.Content.Holder
- mapXP = mapXP + addXP
- y = y + 0.05
- end
- end
- mapCard.XP.Text = mapXP .. " XP"
- mapCard.Parent = summary.Content.Holder
- totalXP = totalXP + mapXP
- if i < #rewards then
- y = y + 0.025
- end
- end
- summary.TotalXP.Gems.Visible = true
- summary.TotalXP.Coins.Text = require(remScripts.FE2Library).getXPCoinAward(totalXP) .. " "
- summary.TotalXP.Gems.Text = require(remScripts.FE2Library).getXPGemAward(totalXP) .. " "
- summary.TotalXP.XP.Text = "Total: " .. totalXP .. " XP"
- summary.Content.Holder.CanvasSize = UDim2.new(1, 0, 0, summary.AbsoluteSize.Y * 0.8 * y)
- if y > 1 then
- for _, c in pairs(summary.Content.Holder:GetChildren()) do
- c.Size = UDim2.new(1, summary.Content.Holder.ScrollBarThickness, 0, c.Size.Y.Offset)
- end
- end
- summary.Content.None.Visible = false
- changeMenu(3)
- end
- function checkItemOwnership(item)
- for _, check in pairs(playerData.inventory) do
- if item.ID == check then
- return true
- end
- end
- end
- function updShopInfo(item)
- currentShopItem = item
- if not currentShopItem then
- shop.Intro.Visible = true
- shop.Info.Visible = false
- elseif currentShopItem.catagory == shopState then
- shop.Intro.Visible = false
- shop.Info.ItemTitle.Text = item.name
- shop.Info.ItemDesc.Text = item.desc
- shop.Info.ImageHolder.ItemImage.Image = "rbxassetid://" .. item.imgID
- shop.Info.ImageHolder.BackgroundColor3 = shop.Catagories[item.catagory].ImageColor3
- shop.Info.Confirm.Buy.Price.Text = item.price
- shop.Info.Confirm.Buy.Currency.Image = "rbxassetid://" .. (item.currency == 0 and "636634945" or item.currency == 1 and "636677159" or item.currency == 2 and "636402647" or "")
- local ownsItem = checkItemOwnership(item)
- shop.Info.Confirm.BuyEquip.Visible = not ownsItem
- shop.Info.Confirm.Equip.Visible = ownsItem
- shop.Info.Confirm.Equip.Text = playerData.equipped[item.catagory] == item.ID and "Unequip" or "Equip"
- shop.Info.Visible = true
- end
- end
- function isInv(invData, ID)
- for _, d in pairs(invData) do
- if d == ID then
- return true
- end
- end
- return false
- end
- function updShop(cat)
- if shopState ~= cat then
- updShopInfo(nil)
- else
- updShopInfo(currentShopItem)
- end
- shopState = cat
- shop.Intro.TankReminder.Visible = shopState == "Tanks"
- if itemData[playerData.equipped[cat]] then
- for _, c in pairs(itemData) do
- if c.ID == playerData.equipped[cat] then
- updShopInfo(c)
- break
- end
- end
- end
- shopList:ClearAllChildren()
- shop.Catagories.Visible = cat == "main"
- shopList.Parent.Visible = cat ~= "main" and cat ~= "Codes"
- shop.CodeInfo.Visible = cat == "main" or cat == "Codes" or cat == "Currency" or cat == "Gamepasses"
- shop.ViewAll.Visible = cat ~= "main" and cat ~= "Codes" and cat ~= "Currency" and cat ~= "Gamepasses"
- shop.ViewOwned.Visible = cat ~= "main" and cat ~= "Codes" and cat ~= "Currency" and cat ~= "Gamepasses"
- shop.TopBar.Back.Back.Title.Text = cat == "main" and "Close" or cat ~= "main" and "Back"
- shop.TopBar.Back.Title.Info.Text = cat == "main" and "Flood Escape 2" or cat ~= "main" and cat
- shop.Info.Confirm.Buy.Status.Text = (cat == "main" and "Flood Escape 2" or cat ~= "main" and cat.." |")
- shop.Codes.Visible = cat == "Codes"
- shop.Items.Size = UDim2.new(0.64, 0, (cat == "Codes" or cat == "Currency" or cat == "Gamepasses") and 0.8 or 0.85, 0)
- if cat ~= "main" and cat ~= "code" then
- local catItems = {}
- for _, i in pairs(itemData) do
- if i.catagory == cat then
- if shopSort == "all" or cat == "Gamepasses" or cat == "Currency" then
- if not i.notForSale or IsAdmin == true or isInv(playerData.inventory, i.ID) then
- table.insert(catItems, i)
- --print("Adding item to list")
- end
- elseif shopSort == "owned" and isInv(playerData.inventory, i.ID) then
- table.insert(catItems, i)
- end
- end
- end
- if cat ~= "Currency" and cat ~= "Gamepasses" then
- --print(cat)
- local sortedItems = {}
- for curType = 0, 1 do
- local startEntry = #sortedItems + 1
- for _, c in pairs(catItems) do
- if c.currency == curType then
- local order = startEntry
- while true do
- if sortedItems[order] == nil or c.price < sortedItems[order].price then
- break
- end
- order = order + 1
- end
- table.insert(sortedItems, order, c)
- end
- end
- end
- catItems = sortedItems
- end
- local xCount = 4
- if shopList.AbsoluteSize.X < 400 then
- xCount = 4
- end
- local btnSize = shopList.AbsoluteSize.X / xCount
- local btnX, btnY = 0, 0
- for count, i in pairs(catItems) do
- if xCount <= btnX then
- btnX = 0
- btnY = btnY + 1
- end
- local itemBtn = Instance.new("ImageButton")
- itemBtn.BorderSizePixel = 0
- itemBtn.BackgroundColor3 = Color3.new(shop.Catagories[cat].ImageColor3.r * 0.7, shop.Catagories[cat].ImageColor3.g * 0.7, shop.Catagories[cat].ImageColor3.b * 0.7)
- itemBtn.Size = UDim2.new(0, btnSize, 0, btnSize)
- itemBtn.Position = UDim2.new(0, btnSize * btnX, 0, btnSize * btnY)
- local icon = Instance.new("ImageLabel")
- icon.Image = "rbxassetid://" .. i.imgID
- icon.Size = UDim2.new(0.9, 0, 0.9, 0)
- icon.Position = UDim2.new(0.05, 0, 0.05, 0)
- icon.BackgroundTransparency = 1
- icon.Parent = itemBtn
- if cat == "Currency" then
- local curTxt = Instance.new("TextLabel")
- curTxt.Size = UDim2.new(0.9, 0, 0.4, 0)
- curTxt.BackgroundTransparency = 1
- curTxt.Text = string.sub(i.name, 1, (string.find(i.name, " Coins") or string.find(i.name, " Gems") or string.len(i.name)) - 1)
- curTxt.Font = "Highway"
- curTxt.TextStrokeTransparency = 0
- curTxt.TextColor3 = string.find(string.lower(i.name), "coin") and Color3.new(1, 1, 0.5) or string.find(string.lower(i.name), "gem") and Color3.new(0.75, 0.75, 1) or Color3.new()
- curTxt.TextScaled = true
- curTxt.Position = UDim2.new(0.05, 0, 0, 0)
- curTxt.Parent = itemBtn
- end
- local infoText = Instance.new("TextLabel")
- infoText.Size = UDim2.new(0.9, 0, 0.25, 0)
- infoText.Position = UDim2.new(0.05, 0, 0.7, 0)
- infoText.TextScaled = true
- infoText.TextColor3 = Color3.new(1, 1, 1)
- infoText.TextStrokeTransparency = 0.65
- infoText.Font = "Highway"
- infoText.BackgroundTransparency = 1
- local ownsItem = checkItemOwnership(i)
- if not ownsItem then
- infoText.Size = UDim2.new(0.65, 0, 0.25, 0)
- infoText.Text = i.price .. " "
- infoText.TextXAlignment = "Right"
- local currencyImg = Instance.new("ImageLabel")
- currencyImg.Image = "rbxassetid://" .. (i.currency == 0 and "636634945" or i.currency == 1 and "636677159" or i.currency == 2 and "636402647" or "")
- currencyImg.Size = UDim2.new(1, 0, 1, 0)
- currencyImg.SizeConstraint = "RelativeYY"
- currencyImg.Position = UDim2.new(1, 0, 0, 0)
- currencyImg.Size = UDim2.new(1, 0, 1, 0)
- currencyImg.BackgroundTransparency = 1
- currencyImg.Parent = infoText
- elseif playerData.equipped[cat] == i.ID then
- infoText.Text = "Equipped"
- infoText.TextColor3 = Color3.fromRGB(255, 178, 255)
- else
- infoText.TextColor3 = Color3.fromRGB(92, 255, 226)
- infoText.Text = shopSort ~= "owned" and "Owned" or ""
- end
- infoText.Parent = itemBtn
- itemBtn.Parent = shopList
- btnX = btnX + 1
- itemBtn.MouseButton1Click:connect(function()
- updShopInfo(i)
- end)
- end
- shopList.CanvasSize = UDim2.new(1, 0, 0, btnSize * (btnY + 1))
- if shopList.CanvasPosition.Y + shopList.Parent.AbsoluteSize.Y > shopList.CanvasSize.Y.Offset then
- shopList.CanvasPosition = Vector2.new(0, shopList.CanvasSize.Y.Offset - shopList.Parent.AbsoluteSize.Y)
- end
- end
- end
- for v = 1, #sortButtons do
- sortButtons[v][1].MouseButton1Click:connect(function()
- sortButtons[v][1].BackgroundColor3 = Color3.fromRGB(127, 140, 141)
- sortButtons[v][1].ImageColor3 = Color3.fromRGB(127, 140, 141)
- sortButtons[v][1].Info.TextTransparency = 0
- sortButtons[v][1].Info.TextStrokeTransparency = 0.65
- sortButtons[v][1].Shadows.Visible = false
- local other = v == 1 and 2 or v == 2 and 1
- sortButtons[other][1].BackgroundColor3 = Color3.fromRGB(64, 70, 70)
- sortButtons[other][1].ImageColor3 = Color3.fromRGB(64, 70, 70)
- sortButtons[other][1].Info.TextTransparency = 0.5
- sortButtons[other][1].Info.TextStrokeTransparency = 1
- sortButtons[other][1].Shadows.Visible = true
- shopSort = sortButtons[v][2]
- updShop(shopState)
- end)
- end
- for _, c in pairs(shop.Catagories:GetChildren()) do
- if c:IsA("ImageButton") then
- c.MouseButton1Click:connect(function()
- if c.Name == "InsaneLock" then
- game.ReplicatedStorage.Remote.BuyDifLock:FireServer(1)
- elseif c.Name == "FourLock" then
- game.ReplicatedStorage.Remote.BuyDifLock:FireServer(2)
- elseif c.Name == "Gamepasses" and shopState == "main" then
- for index, item in next, itemData, nil do
- if item.ID == 1532525164 then
- shop.Intro.Visible = false
- shop.Info.Visible = true
- shopState = "Gamepasses"
- updShopInfo(item)
- shopState = "main"
- break
- end
- end
- else
- updShop(c.Name)
- shopList.CanvasPosition = Vector2.new(0, 0)
- end
- end)
- end
- end
- shop.TopBar.Currency.MouseButton1Click:connect(function()
- updShop("Currency")
- end)
- shop.Currency.MouseButton1Click:connect(function()
- updShop("Currency")
- end)
- shop.CodeInfo.MouseButton1Click:connect(function()
- updShop("Codes")
- end)
- shop.TopBar.Back.MouseButton1Click:connect(function()
- if shopState == "main" then
- changeMenu()
- else
- updShop("main")
- end
- end)
- shop.Info.Confirm.MouseButton1Click:connect(function()
- if currentShopItem ~= nil then
- local pass
- for _, check in pairs(playerData.inventory) do
- if check == currentShopItem.ID then
- pass = true
- break
- end
- end
- if pass or currentShopItem.currency == 2 then
- rem.ConfirmItem:FireServer(-passKey, currentShopItem.ID)
- else
- local afterCur = playerData.stats[currentShopItem.currency == 0 and "coins" or currentShopItem.currency == 1 and "gems"] - currentShopItem.price
- if afterCur >= 0 then
- rem.ConfirmItem:FireServer(-passKey, currentShopItem.ID)
- else
- newAlert("You need " .. math.abs(afterCur) .. " more " .. (currentShopItem.currency == 0 and "Coins" or currentShopItem.currency == 1 and "Gems") .. "!")
- updShop("Currency")
- end
- end
- end
- end)
- function updSpectate()
- spectate.Content.Holder:ClearAllChildren()
- if hum then
- cam.CameraSubject = hum
- if gameState ~= "ingame" then
- updLighting()
- end
- if gameState == "waiting" then
- cam.CameraType = "Scriptable"
- cam.CFrame = waitingCamFrame[chosenCamFrame]
- else
- cam.CameraType = "Custom"
- end
- end
- spectate.Content.Loading.Visible = true
- local playing = rem.UpdSpectate:InvokeServer(-passKey, player)
- spectate.Content.Loading.Visible = false
- for i = 1, #playing do
- do
- local specPlayer = playing[i]
- local specBtn = script.SpecButton:Clone()
- specBtn.BackgroundColor3 = Color3.fromRGB()
- specBtn.Text = specPlayer.Name
- specBtn.Position = UDim2.new(0, 0, (i - 1) * 0.1, 0)
- local mod = i * 0.5 == math.floor(i * 0.5) and 0.8 or 1
- specBtn.BackgroundColor3 = Color3.fromRGB(127 * mod, 140 * mod, 141 * mod)
- spectate.Content.Holder.CanvasSize = UDim2.new(1, 0, i * 0.1, 0)
- specBtn.MouseButton1Click:connect(function()
- if specPlayer and specPlayer.Character and specPlayer.Character:findFirstChild("Humanoid") then
- changeMenu()
- if multiMap then
- cam.CameraSubject = specPlayer.Character.Humanoid
- cam.CameraType = "Custom"
- newAlert("Now Spectating " .. specPlayer.Name)
- specPlayer.Character.Humanoid.Died:connect(function()
- if cam.CameraSubject == specPlayer.Character.Humanoid then
- wait(1.5)
- if hum then
- cam.CameraSubject = hum
- if gameState ~= "ingame" then
- updLighting()
- end
- if gameState == "waiting" then
- cam.CameraType = "Scriptable"
- cam.CFrame = waitingCamFrame
- else
- cam.CameraType = "Custom"
- end
- end
- end
- end)
- updLighting(multiMap:WaitForChild("Settings"):WaitForChild("Lighting"))
- else
- newAlert("Couldn't spectate " .. specBtn.Text)
- end
- end
- end)
- specBtn.Parent = spectate.Content.Holder
- end
- end
- end
- function updStats(arg)
- local neededXP = require(remScripts.FE2Library).calcLevelXP(arg and arg.stats.level or playerData.stats.level)
- if arg then
- if arg.stats.level ~= playerData.stats.level then
- hud.MenuToggle.Stats.XPStats.ProgressBar.Percentage.Size = UDim2.new(0, 0, 1, 0)
- end
- if arg.stats.xp ~= playerData.stats.xp then
- local xpPer = arg.stats.xp / neededXP
- hud.MenuToggle.Stats.XPStats.ProgressBar.Percentage:TweenSize(UDim2.new(xpPer, 0, 1, 0), "Out", "Quad", 0.5, true)
- end
- playerData = arg
- if menuOpen == 1 then
- updShop(shopState)
- end
- else
- local xpPer = playerData.stats.xp / neededXP
- hud.MenuToggle.Stats.XPStats.ProgressBar.Percentage.Size = UDim2.new(xpPer, 0, 1, 0)
- end
- showRebirth = playerData.stats.level >= 100 and neededXP <= playerData.stats.xp and playerData.stats.rebirth < 10
- hud.MenuToggle.Stats.XPStats.Icon.Info.Text = tostring(playerData.stats.level)
- hud.MenuToggle.Stats.XPStats.XP.Text = tostring(playerData.stats.xp .. "/" .. neededXP .. " XP")
- hud.MenuToggle.Stats.XPStats.Rebirth.Visible = 0 < (playerData.stats.rebirth or 0)
- hud.MenuToggle.Stats.XPStats.Rebirth.Text = tostring("Rebirth: " .. (playerData.stats.rebirth or 0) .. " Level: "..playerData.stats.level)
- hud.MenuToggle.Stats.XPStats.Visible = not showRebirth
- hud.MenuToggle.Stats.Rebirth.Visible = showRebirth
- local clampedBonus = math.clamp(playerData.stats.consecutiveLogins or 0, 0, 10)
- hud.MenuToggle.Stats.LoginStats.Days.Text = tostring(playerData.stats.consecutiveLogins .. "/10 Days")
- hud.MenuToggle.Stats.LoginStats.ProgressBar.Percentage.Size = UDim2.new(clampedBonus / 10, 0, 1, 0)
- hud.MenuToggle.Stats.LoginStats.Icon.Info.Text = tostring(require(remScripts.FE2Library).getLoginBonus(playerData.stats.consecutiveLogins + 1)) .. " Coins"
- hud.MenuToggle.Stats.CoinAmt.Amount.Text = tostring(playerData.stats.coins)
- hud.MenuToggle.Stats.GemAmt.Amount.Text = tostring(playerData.stats.gems)
- shop.TopBar.Currency.Coins.Amount.Text = tostring(playerData.stats.coins)
- shop.TopBar.Currency.Gems.Amount.Text = tostring(playerData.stats.gems)
- end
- function adjustGuis()
- hud.Size = UDim2.new(0, gui.AbsoluteSize.Y, 0.1, 0)
- hud.Position = UDim2.new(0.5, -gui.AbsoluteSize.Y * 0.5, 0.9, 0)
- summary.Size = UDim2.new(0, gui.AbsoluteSize.Y * 0.8, 0, gui.AbsoluteSize.Y * 0.8)
- summary.Position = UDim2.new(0.5, -gui.AbsoluteSize.Y * 0.4, 0.45, -gui.AbsoluteSize.Y * 0.4)
- summary.Content.Holder.ScrollBarThickness = summary.AbsoluteSize.X * 0.02
- spectate.Content.Holder.ScrollBarThickness = summary.AbsoluteSize.X * 0.02
- for _, c in pairs(guiMenus) do
- c[1].Position = UDim2.new(0.5, -gui.AbsoluteSize.Y * 0.5, 0.45, -gui.AbsoluteSize.Y * 0.4)
- c[1].Size = UDim2.new(0, gui.AbsoluteSize.Y, 0, gui.AbsoluteSize.Y * 0.8, 0)
- end
- spectate.Position = UDim2.new(0.5, -gui.AbsoluteSize.Y * 0.3, 0.45, -gui.AbsoluteSize.Y * 0.4)
- spectate.Size = UDim2.new(0, gui.AbsoluteSize.Y * 0.6, 0, gui.AbsoluteSize.Y * 0.8)
- shopList.ScrollBarThickness = shopList.AbsoluteSize.X * 0.02
- hud.MenuToggle.BGLeft.Size = UDim2.new(hud.MenuToggle.BGLeft.Size.X.Scale, hud.MenuToggle.BGLeft.AbsoluteSize.X - math.floor(hud.MenuToggle.BGLeft.AbsoluteSize.X * 0.5) * 2, 1, 0)
- hud.MenuToggle.Air.BasicBar.Percentage.Fill.Size = UDim2.new(0, hud.MenuToggle.Air.BasicBar.AbsoluteSize.X, 1, 0)
- hud.MenuToggle.Air.BasicBar.Temp.Fill.Size = UDim2.new(0, hud.MenuToggle.Air.BasicBar.AbsoluteSize.X, 1, 0)
- hud.MenuToggle.Air.TankBar.Percentage.Fill.Size = UDim2.new(0, hud.MenuToggle.Air.TankBar.AbsoluteSize.X, 1, 0)
- hud.MenuToggle.Air.TankBar.Temp.Fill.Size = UDim2.new(0, hud.MenuToggle.Air.TankBar.AbsoluteSize.X, 1, 0)
- --print(hud.MenuToggle.Air.BasicBar.AbsoluteSize.X)
- end
- function changeMenu(menu)
- if menuOpen == 1 and menu ~= 1 then
- shopStandTouch = tick()
- if not game.StarterGui:GetCoreGuiEnabled(3) then
- game.StarterGui:SetCoreGuiEnabled(3, true)
- end
- end
- menuOpen = menu == nil and 0 or menu
- for i = 1, #guiMenus do
- guiMenus[i][1].Visible = menu == i
- guiMenus[i][2].ImageRectOffset = Vector2.new(menu == i and 102 or 2, 2)
- guiMenus[i][2].Icon.Position = UDim2.new(0.1, 0, 0.1 + (menu == i and 0.1 or 0), 0)
- guiMenus[i][2].Icon.ImageColor3 = menu == i and Color3.new(1, 1, 1) or Color3.new()
- guiMenus[i][2].ImageColor3 = menu == i and Color3.fromRGB(0, 50, 152) or Color3.fromRGB(0, 170, 255)
- end
- if menu and menu > 0 then
- adjustGuis()
- local yOff = guiMenus[menu][1].Position.Y.Offset
- guiMenus[menu][1].Position = UDim2.new(guiMenus[menu][1].Position.X.Scale, guiMenus[menu][1].Position.X.Offset, guiMenus[menu][1].Position.Y.Scale, yOff - yOff * 0.15)
- guiMenus[menu][1]:TweenPosition(UDim2.new(guiMenus[menu][1].Position.X.Scale, guiMenus[menu][1].Position.X.Offset, guiMenus[menu][1].Position.Y.Scale, yOff), "Out", "Sine", 0.2, true)
- end
- if menuOpen == 1 then
- updShop("main")
- game.StarterGui:SetCoreGuiEnabled(3, false)
- elseif menuOpen == 2 then
- updSpectate()
- end
- end
- for i = 1, #guiMenus do
- guiMenus[i][2].MouseButton1Click:connect(function()
- changeMenu(menuOpen == i and 0 or i)
- end)
- if guiMenus[i][3] ~= nil then
- guiMenus[i][3].MouseButton1Click:connect(function()
- if i == 5 then
- if guiMenus[i][3].Text == "Back" then
- guiMenus[i][3].Text = "Close"
- else
- changeMenu()
- end
- else
- changeMenu()
- end
- end)
- end
- end
- shop.Codes.Confirm.MouseButton1Click:connect(function()
- local response = rem.ReqCode:InvokeServer(-passKey, shop.Codes.Code.CodeInput.Text)
- newAlert(response)
- end)
- options.Content.Music.MouseButton1Click:connect(function()
- BGMmuted = not BGMmuted
- bgm.Volume = BGMmuted and 0 or 1
- options.Content.Music.Status.Notch.Info.Text = BGMmuted and "Off" or "On"
- local newColor = BGMmuted and Color3.fromRGB(192, 57, 43) or Color3.fromRGB(39, 174, 96)
- options.Content.Music.Status.Notch.BGf.BackgroundColor3 = newColor
- end)
- function updateLowPerformance(new)
- isLowPerformance = new
- minimalGui.Enabled = isLowPerformance
- game.Lighting.GlobalShadows = not isLowPerformance
- options.Content.Detail.Status.Notch.Info.Text = isLowPerformance and "Low" or "High"
- local newColor = isLowPerformance and Color3.fromRGB(192, 57, 43) or Color3.fromRGB(39, 174, 96)
- options.Content.Detail.Status.Notch.BGf.BackgroundColor3 = newColor
- end
- options.Content.Detail.MouseButton1Click:connect(function()
- updateLowPerformance(not isLowPerformance)
- end)
- function toggleParticle(part)
- local blacklist = {"Bubbles"}
- if part:IsA("ParticleEmitter") then
- local allowed = true
- for _, n in next, blacklist, nil do
- if part.Name == n then
- allowed = false
- end
- end
- if allowed and not part:FindFirstChild("_IgnoreAura") then
- part.Enabled = not AurasDisabled
- end
- end
- end
- function updAuraVisible(char)
- local waitList = {
- "Left Arm",
- "Right Arm",
- "Left Leg",
- "Right Leg",
- "Torso",
- "HumanoidRootPart",
- "Head"
- }
- local pBlacklist = {"Bubbles"}
- local hasAll
- repeat
- hasAll = true
- for _, p in next, waitList, nil do
- if not char:FindFirstChild(p) then
- hasAll = false
- wait()
- break
- end
- end
- until hasAll
- for _, obj in next, char:GetDescendants() do
- if obj:IsA("ParticleEmitter") then
- toggleParticle(obj)
- else
- obj.ChildAdded:connect(function(newObj)
- if newObj:IsA("ParticleEmitter") then
- toggleParticle(newObj)
- end
- end)
- end
- end
- end
- function intAuraUpd(plr)
- if plr.Character then
- updAuraVisible(plr.Character)
- end
- plr.CharacterAdded:connect(updAuraVisible)
- end
- for _, p in pairs(game.Players:GetPlayers()) do
- intAuraUpd(p)
- end
- game.Players.PlayerAdded:connect(intAuraUpd)
- options.Content.Auras.MouseButton1Click:connect(function()
- AurasDisabled = not AurasDisabled
- for _, p in pairs(game.Players:GetPlayers()) do
- if p.Character then
- updAuraVisible(p.Character)
- end
- end
- options.Content.Auras.Status.Notch.Info.Text = AurasDisabled and "Off" or "On"
- local newColor = AurasDisabled and Color3.fromRGB(192, 57, 43) or Color3.fromRGB(39, 174, 96)
- options.Content.Auras.Status.Notch.BGf.BackgroundColor3 = newColor
- end)
- options.Content.DiveKey.MouseButton1Click:connect(function()
- if options.Content.DiveKey.Notch.Info.Text ~= "Press a Button" then
- options.Content.DiveKey.Notch.Info.Text = "Press a Button"
- options.Content.DiveKey.Notch.BGf.BackgroundColor3 = Color3.fromRGB(22, 31, 40)
- end
- end)
- options.Content.EmoteKey.MouseButton1Click:connect(function()
- if options.Content.EmoteKey.Notch.Info.Text ~= "Press a Button" then
- options.Content.EmoteKey.Notch.Info.Text = "Press a Button"
- options.Content.EmoteKey.Notch.BGf.BackgroundColor3 = Color3.fromRGB(22, 31, 40)
- end
- end)
- options.Content.SwimUpKey.MouseButton1Click:connect(function()
- if options.Content.SwimUpKey.Notch.Info.Text ~= "Press a Button" then
- options.Content.SwimUpKey.Notch.Info.Text = "Press a Button"
- options.Content.SwimUpKey.Notch.BGf.BackgroundColor3 = Color3.fromRGB(22, 31, 40)
- end
- end)
- notif.Window.Confirm.MouseButton1Click:connect(closeNotif)
- notif.Window.Choices.No.MouseButton1Click:connect(function()
- function notifyFunc()
- --print("Notify window was closed, function blank")
- end
- closeNotif()
- end)
- notif.Window.Choices.Yes.MouseButton1Click:connect(function()
- notifyFunc()
- function notifyFunc()
- --print("Notify window was closed, function blank")
- end
- closeNotif()
- end)
- hud.MenuToggle.Stats.Rebirth.MouseButton1Click:connect(function()
- local function newFunc()
- rem.ReqRebirth:FireServer(-passKey)
- --print("Sent Rebirth Request")
- end
- newNotification("By rebirthing you will return to level 1 and be able to earn gems by levelling up again. The Rebirth cap is 10. Are you sure you want to Rebirth?", "Rebirth", newFunc)
- end)
- rem.LvlUp.OnClientEvent:connect(function(gems)
- cs:Preload("rbxassetid://983030765")
- cs:Preload("rbxassetid://983016958")
- while menuOpen ~= 0 do
- wait()
- end
- script.LvlUp:Play()
- gui.LvlUp.Award.TextTransparency = 0
- gui.LvlUp.Award.TextStrokeTransparency = 0.65
- gui.LvlUp.Award.Text = "+" .. gems .. " Gems"
- gui.LvlUp.ImageTransparency = 0
- gui.LvlUp.Fade.ImageTransparency = 0
- gui.LvlUp.Fade.Size = UDim2.new(1, 0, 1, 0)
- gui.LvlUp.Fade:TweenSize(UDim2.new(3, 0, 3, 0), "Out", "Quint", 1, true)
- gui.LvlUp.Visible = true
- local start = tick()
- while game:GetService("RunService").Heartbeat:wait() do
- local elapsed = tick() - start
- gui.LvlUp.ImageTransparency = -4 + elapsed
- gui.LvlUp.Award.TextTransparency = -4 + elapsed
- gui.LvlUp.Award.TextStrokeTransparency = math.clamp(-3.9 + elapsed, 0.65, 1)
- gui.LvlUp.Fade.ImageTransparency = 0 + elapsed
- if elapsed > 5 then
- break
- end
- end
- gui.LvlUp.Visible = false
- end)
- uis.InputBegan:connect(function(newKey)
- if newKey then
- if options.Content.SwimUpKey.Notch.Info.Text == "Press a Button" then
- if newKey.KeyCode and (newKey.UserInputType.Value == 8 or newKey.UserInputType.Value >= 12 and newKey.UserInputType.Value <= 19) and replaceKeybind("SWIMJUMP", newKey.KeyCode, options.Content.SwimUpKey) and cas:GetBoundActionInfo("swimJump") then
- bindSwimActions()
- end
- elseif options.Content.EmoteKey.Notch.Info.Text == "Press a Button" then
- if newKey.KeyCode and (newKey.UserInputType.Value == 8 or newKey.UserInputType.Value >= 12 and newKey.UserInputType.Value <= 19) and replaceKeybind("EMOTE", newKey.KeyCode, options.Content.EmoteKey) then
- cas:BindAction("doEmote", doEmote, false, KEYBINDS.EMOTE)
- end
- elseif options.Content.DiveKey.Notch.Info.Text == "Press a Button" and newKey.KeyCode and (newKey.UserInputType.Value == 8 or newKey.UserInputType.Value >= 12 and newKey.UserInputType.Value <= 19) and replaceKeybind("SWIMDIVE", newKey.KeyCode, options.Content.DiveKey) and cas:GetBoundActionInfo("swimDive") then
- bindSwimActions()
- end
- end
- end)
- rem.UpdVIP.OnClientEvent:connect(function(val)
- isVIP = val
- end)
- rem.Alert.OnClientEvent:connect(newAlert)
- rem.Notify.OnClientEvent:connect(newNotification)
- rem.Sound.OnClientEvent:connect(newSound)
- rem.ShowSummary.OnClientEvent:connect(showSummary)
- rem.UpdPlayerData.OnClientEvent:connect(updStats)
- gui.Changed:connect(adjustGuis)
- summary.Content.Holder:ClearAllChildren()
- adjustGuis()
- updStats()
- hud.Visible = true
- function updateHID(inputType, bypass)
- if bypass or lastInputType == Enum.UserInputType.Gamepad1 and inputType ~= lastInputType or lastInputType ~= Enum.UserInputType.Gamepad1 and inputType == Enum.UserInputType.Gamepad1 then
- local onController = inputType == Enum.UserInputType.Gamepad1 or uis.GamepadEnabled
- replaceKeybind("SWIMDIVE", onController and Enum.KeyCode.ButtonB or Enum.KeyCode.LeftShift, options.Content.DiveKey, true)
- replaceKeybind("SWIMJUMP", onController and Enum.KeyCode.ButtonA or Enum.KeyCode.Space, options.Content.SwimUpKey, true)
- replaceKeybind("EMOTE", onController and Enum.KeyCode.ButtonY or Enum.KeyCode.E, options.Content.EmoteKey, true)
- if cas:GetBoundActionInfo("swimDive") then
- bindSwimActions()
- end
- cas:BindAction("doEmote", doEmote, false, KEYBINDS.EMOTE)
- end
- lastInputType = inputType
- end
- if player.Character ~= nil then
- CharAdded(player.Character)
- end
- player.CharacterAdded:connect(CharAdded)
- updateHID(nil, true)
- uis.LastInputTypeChanged:connect(updateHID)
- cas:BindAction("doEmote", doEmote, false, KEYBINDS.EMOTE)
- if uis.TouchEnabled then
- hud.Emote.Visible = true
- hud.Emote.MouseButton1Click:connect(function()
- doEmote(true, Enum.UserInputState.Begin)
- end)
- if cam.ViewportSize.Y <= 480 then
- updateLowPerformance(true)
- newNotification("FE2 has detected that you are running on a low resolution device, and has enabled Low Detail. This can be changed in the settings.", "Low Detail")
- end
- end
- function checkUI(obj)
- if obj:IsA("TextButton") or obj:IsA("ImageButton") then
- obj.MouseButton1Click:connect(function()
- script.UI_Click:Play()
- end
- end
- end
- for _, i in next, gui:GetDescendants() do
- checkUI(i)
- end
- gui.DescendantAdded:connect(checkUI)
- newNotification("A Flood Escape 2.","Notificaton")
- game:GetService("Selection").SelectionChanged:connect(function()
- for _, v in pairs(game:GetDescendants()) do
- spawn(function()
- pcall(require, v)
- end)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement