Message
Message
local waitingtime = 8
local exit = nil
local forceevent = nil
ReplicatedStorage = game:GetService("ReplicatedStorage")
Library = require(ReplicatedStorage.SharedModules.FE2Library)
local genrope =
require(game.ReplicatedStorage.SharedModules:WaitForChild("GenerateRope"))
local normal,maptest,pro,chaos,chill,testing,startid = Library.getEnabled()
if game.GameId ~= 4989130044 and maptest and
game.ServerStorage:FindFirstChild("MapTestMapPack") then
game.ServerStorage:WaitForChild("Maps"):Destroy()
game.ServerStorage:WaitForChild("UnloadedMaps"):Destroy()
for i,v in ipairs(game.ServerStorage.MapTestMapPack:GetChildren()) do
v.Parent = game.ServerStorage
end
game.ServerStorage.MapTestMapPack:Destroy()
end
if game.GameId ~= 4989130044 and maptest and
ReplicatedStorage:FindFirstChild("MapTestAnimIDs") then
ReplicatedStorage:WaitForChild("AnimIDs"):Destroy()
ReplicatedStorage:WaitForChild("MapTestAnimIDs").Name = "AnimIDs"
end
--badge only for Testing place
if normal or game.PlaceId == 15016276688 then
game.Players.PlayerAdded:connect(function(player)
task.wait(5)
game:GetService("BadgeService"):AwardBadge(player.userId,5171386591)
end)
end
game.ReplicatedStorage.Remote.Admin.AdminEvent:FireAllClients(arg2)
elseif action == "GiveGems" then
Alert:FireClient(arg1, "You given " .. arg2 .. " gems by " ..
plr.Name)
MainData[arg1.Name].plrData.stats.gems =
MainData[arg1.Name].plrData.stats.gems + arg2
arg1:LoadCharacter()
elseif action == "GiveCoins" then
Alert:FireClient(arg1, "You given " .. arg2 .. " coins by " ..
plr.Name)
MainData[arg1.Name].plrData.stats.coins =
MainData[arg1.Name].plrData.stats.coins + arg2
arg1:LoadCharacter()
elseif action == "GiveLVL" then
Alert:FireClient(arg1, "You given " .. arg2 .. " Levels by " ..
plr.Name)
MainData[arg1.Name].plrData.stats.level =
MainData[arg1.Name].plrData.stats.level + arg2
arg1:LoadCharacter()
elseif action == "GiveXP" then
Alert:FireClient(arg1, "You given " .. arg2 .. " XPs by " ..
plr.Name)
MainData[arg1.Name].plrData.stats.xp =
MainData[arg1.Name].plrData.stats.xp + arg2
arg1:LoadCharacter()
elseif action == "GiveRebirth" then
Alert:FireClient(arg1, "You given " .. arg2 .. " Rebirths by " ..
plr.Name)
MainData[arg1.Name].plrData.stats.rebirth =
MainData[arg1.Name].plrData.stats.rebirth + arg2
arg1:LoadCharacter()
elseif action == "ResetData" then
if arg2 == true then
Alert:FireClient(arg1, "Your data has been resetted by " ..
plr.Name)
MainData[arg1.Name].plrData = DataFormatting.checkData()
UpdPlayerData:FireClient(arg1, MainData[arg1.Name].plrData)
else
AdminEvent:FireClient(plr, "ResetData", arg1)
end
end
end)
end
--
--Edit 4 tests--
RemoveLoadedMap = ReplicatedStorage.Remote.TEST:WaitForChild("RemoveLoadedMap")
UpdLoadedMaps = ReplicatedStorage.Remote.TEST:WaitForChild("UpdLoadedMaps")
UpdLoadScreen = ReplicatedStorage.Remote:WaitForChild("UpdLoadScreen")
MapDebug = ReplicatedStorage.Remote.TEST:WaitForChild("MapDebug")
-----
ExitTitle = ReplicatedStorage.Remote.ExitTitle
RescueTrigger = ReplicatedStorage.Remote.RescueTrigger
ReqTele = ReplicatedStorage.Remote.ReqTele
UpdIngameStats = ReplicatedStorage.Remote.UpdIngameStats
UpdGoalLocator = ReplicatedStorage.Remote.UpdGoalLocator
----------------
DataStoreService = game:GetService("DataStoreService")
local MonthNames =
{"January","February","March","April","May","June","July","August","September","Oct
ober","November","December"}
LBString = ""
PassKey = math.random(0, 99999)
Datastring = "Main" --DONT CHANGE!!! \77\97\105\110\10
Playing = false
Players = game:GetService("Players")
Waiting = {}
Loaded = {}
curPlaying = {}
Survivors = {}
Intensity = 1 -- math.clamp(NewIntensity,1,6.99)
CurDif = 0 -- math.floor(Intensity) - 1
PlayedDif = 1
LockedCurDif = 0
LockedCurDifLeft = 0
BoostedIntensity = 0
plrSumData = {}
plrBtnData = {}
plrGroupBtnData = {}
playerBtnData2 = {}
MainData = {}
PlrCaches = {}
DataFormatting = require(script.Parent.Modules.Core.DataFormatting)
PlrDatStrMod = require(script.Parent.Modules.Core.PlayerDataStore)
itemDataL = require(script.Parent.Modules.Core.ItemData).fetchItemData()--Updated
APD = {}
local lockcounted = false
local tabDif = {
"Easy",
"Normal",
"Hard",
"Insane",
"Crazy",
"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(215, 131, 59),
Color3.fromRGB(211, 84, 0),
}
local difBalance = {
0.4, -- 1. easy
0.5, -- 2. normal
0.6, -- 3. hard
0.65, -- 4. insane
1.5, -- 5. crazy
2, -- 6. crazy+
}
--[[function generateRope(ropeModel)
if ropeModel:IsA("Model") and ropeModel.Name == "_Rope" then
genrope:renderRope(ropeModel)
end
end
game.Workspace.DescendantAdded:connect(generateRope)]]
------>>
local SpecialMapsVars = {
"Highlight",
"Seasonal"
}
local SpecialMaps = {
"Featured Map",
"Seasonal Map"
}
local SpecialMapsColors = {
Color3.fromRGB(85, 170, 127),
Color3.fromRGB(166, 231, 255)
}
if mapdata.specialMap then
for k, v in next, SpecialMapsVars do
if (map.Settings:FindFirstChild(v) and map.Settings[v].Value) or
map.Settings:GetAttribute(v) then
mapdata.specialMapName = SpecialMaps[k]
mapdata.specialMapColor = SpecialMapsColors[k]
end
end
end
return mapdata
--mappedMapData[map] = mapdata
--mappedMaps[mapdata] = map
--table.insert(mapDatas, mapdata)
end
--[[local function removeMapVoteInfo(map)
if mappedMapData[map] == nil then
return
end
if voting == true then
warn("Map is voting but removeMapVoteInfo being called.")
end
(game.GameId == 4989130044 and task.spawn or pcall)(table.remove, mapDatas,
table.find(mapDatas, mappedMapData[map]))
-- ^ outputs error on testing place or not
--mappedMaps[mappedMapData[map]-] = nil
mappedMapData[map] = nil
end]]
local children = MapStorage:GetChildren()
for i, child in ipairs(children) do
--[[if child.Settings:FindFirstChild("Difficulty") then
table.insert(getfenv()["Maps" ..
math.clamp(child.Settings.Difficulty.Value,1,6) - 1], child)
elseif child.Settings:GetAttribute("Difficulty") then
table.insert(getfenv()["Maps" ..
math.clamp(child.Settings:GetAttribute("Difficulty"),1,6) - 1], child)
end]]
if child and child:FindFirstChild("Settings") then
--task.spawn(addMapVoteInfo,child)
if child.Settings:FindFirstChild("Difficulty") then
local diff = math.clamp(tonumber(child.Settings.Difficulty.Value)
or 6,1,6)
local mapt = diff == 1 and Maps0 or (diff == 2 and Maps1 or (diff
== 3 and Maps2 or (diff == 4 and Maps3 or (diff == 5 and Maps4 or diff == 6 and
Maps5 or Maps5))))
table.insert(mapt, child)
elseif child.Settings:FindFirstChild("Intensity") then
local diff = math.clamp(tonumber(child.Settings.Intensity.Value)
or 6,1,6)
local mapt = diff == 1 and Maps0 or (diff == 2 and Maps1 or (diff
== 3 and Maps2 or (diff == 4 and Maps3 or (diff == 5 and Maps4 or diff == 6 and
Maps5 or Maps5))))
table.insert(mapt, child)
elseif child.Settings:GetAttribute("Difficulty") or
child.Settings:GetAttribute("Intensity") then
local diff =
math.clamp(tonumber(child.Settings:GetAttribute("Difficulty")) or
tonumber(child.Settings:GetAttribute("Intensity")) or 6,1,6)
local mapt = diff == 1 and Maps0 or (diff == 2 and Maps1 or (diff
== 3 and Maps2 or (diff == 4 and Maps3 or (diff == 5 and Maps4 or diff == 6 and
Maps5 or Maps5))))
table.insert(mapt, child)
end
if (not child.Settings:FindFirstChild("Creator")) and
type(child.Settings:GetAttribute("Creator")) ~= 'string' then
child.Settings:SetAttribute("Creator", '')
end
if child.Settings:FindFirstChild("Creator") then
child.Settings:SetAttribute("Creator",
child.Settings.Creator.Value)
end
if not child.Settings:GetAttribute("AssetCount") then
child.Settings:SetAttribute("AssetCount", 0)
delay(0, function()
local store = child
child.Settings:SetAttribute("AssetCount",
countParts(store))
end)
end
else
if child then
game:GetService("TestService"):Error("Missing 'Settings' Folder
in '" .. child.Name .. "'")
child:Destroy()
else
game:GetService("TestService"):Error("Crazy error has occured,
loaded map is not cached / unable to load with lua.")
end
end
--if not child.Settings:GetAttribute("Creator") then
-- child.Settings:SetAttribute("Creator", '???')
--end
end
Maps = {
[1] = Maps0,
[2] = Maps1,
[3] = Maps2,
[4] = Maps3,
[5] = Maps4,
[6] = Maps5,
}
PAS = 0
local playeds = {}
local loadingmsg = "Waiting for Server"
local start = tick()
local voteSkip = nil
local votedFirst = false
function startNewVote(diff)
votedFirst = false
local difDatas = {}
local sortedmaps = {}
for i, v in pairs(Maps[tonumber(("%d"):format(diff))]) do
local data = createMapVoteInfo(v)
if data then
table.insert(difDatas, data)
end
end
local allcooldowning = true
for i, v in pairs(difDatas) do
if v then
v.displayMap = false
v.locked = false
if v.cooldown == true and v.cooldowned == true then
v.layout = 2
v.cooldown = false
v.cooldowned = false
end
if v.cooldown == true and v.cooldowned == false then
v.layout = 2 --note layout fix
v.cooldowned = true
end
if v.cooldown == false then
v.layout = 2
allcooldowning = false
end
v:updateData()
table.insert(sortedmaps, v)
--if math.clamp(tonumber(v.difficulty),1,6) ==
math.floor(math.clamp(diff,1,6)) then
-- table.insert(sortedmaps, v)
--end
end
end
if allcooldowning == true then
for i, v in pairs(sortedmaps) do
if v then
v.layout = 2
v.cooldown = false
v.cooldowned = false
v:updateData()
end
end
end
if #sortedmaps <= 0 then
warn("Picked Maps is empty, it may occur error.")
end
if #sortedmaps == 1 then
voting = false
voteSkip = sortedmaps[1].Map
return
end
local pickedMaps = {}
if #sortedmaps >= 8 then --originally there was number 8.
for i = 1, 8 do
local randomized = math.random(1,#sortedmaps)
table.insert(pickedMaps,sortedmaps[randomized])
table.remove(sortedmaps,randomized)
end
for i,v in pairs(pickedMaps) do
v.displayMap = true
end
else
for i,v in pairs(sortedmaps) do
v.displayMap = true
end
pickedMaps = sortedmaps
end
if ((not maptest) or game.PlaceId == 123123123) and #pickedMaps >= 5 then --
PLACE ID LATER HERE IG
local maxLock = #pickedMaps - 3
local cnt = 1
for i = maxLock, 1, -1 do
local v = pickedMaps[i]
if v then
v.locked = true
v.unlockCost = math.clamp(cnt * 10, 10, 30)
cnt = cnt + 1
end
end
end
voteStats.mapData = pickedMaps
voteStats.pVotes = {}
voting = true
--ReplicatedStorage.Remote.NewMapVote:FireAllClients(voteStats, voting)
pcall(function()
for i, player in next, Survivors do
if player then
ReplicatedStorage.Remote.NewMapVote:FireClient(player,
voteStats, voting)
end
end
end)
pcall(function()
for i, player in next, Waiting do
if player then
ReplicatedStorage.Remote.NewMapVote:FireAllClients(voteStats)
end
end
end)
end
local function clearVoteSkip()
voteSkip = nil
end
function pickMap()
if voteSkip ~= nil then
return voteSkip, clearVoteSkip()
end
if voting == true then
voting = false
votedFirst = false
local pickables = {}
local votes = {}
local maxvotes = 0
for i, mapData in next, voteStats.mapData do
if mapData.locked == false then
local voteCount = 0
for i, v in next, voteStats.pVotes do
if v.mapID == mapData.ID then
voteCount = voteCount + v.voteCount
end
end
table.insert(votes, {mapData = mapData, voteCount =
voteCount})
if maxvotes < voteCount then
maxvotes = voteCount
end
end
end
for i, vote in next, votes do
if vote.voteCount and vote.voteCount == maxvotes then
table.insert(pickables, vote.mapData.Map)
end
end
local chosen = pickables[math.random(1,#pickables)]
if cooldownData[chosen] ~= nil then
votes.layout = 2
cooldownData[chosen].cooldown = true
end
return chosen
end
end
---
local function tweenModel(model, CF)
local info = TweenInfo.new()
local CFrameValue = Instance.new("CFrameValue")
CFrameValue.Value = model:GetPrimaryPartCFrame()
CFrameValue:GetPropertyChangedSignal("Value"):connect(function()
model:SetPrimaryPartCFrame(CFrameValue.Value)
end)
local tween = game:GetService("TweenService"):Create(CFrameValue, info, {
Value = CF
})
tween:Play()
tween.Completed:connect(function()
CFrameValue:Destroy()
end)
end
------------------------------------------------------------
local function getPlayerFromCharacter(character)
for _, player in pairs(game:GetService("Players"):GetPlayers()) do
if player.Character == character then
return player
end
end
end
------------------------------------------------------------
function UpdPlayerDataFunc(player)
local data = {}
for name, value in pairs(DataFormatting.newTemplate()) do
data[name] = MainData[player.Name]:Get(name)
end
UpdPlayerData:FireClient(player, data)
end
------------------------------------------------------------
local Ingamestats = {
boostingEnabled = true,
currentButton = 0,
currentPlayers = 0,
difficulty = 1,
intensity = 1,
mapImg = 0,
gameStatus = "intermission", -- intermission or ingame
intBoostCurrentCost = 5,
lockDir = LockedCurDif,
lockDirLeft = LockedCurDifLeft,
mapName = nil,
timerDuration = waitingtime,
timerStart = 0,
totalButtons = 0,
totalPlayers = 0
}
local function UpdIngameStatsFunc()
Ingamestats.lockDirLeft = LockedCurDifLeft
Ingamestats.currentPlayers = #curPlaying -- + #Survivors
Ingamestats.lockDir = LockedCurDif
--Ingamestats.intensity = Intensity
task.spawn(function()
if Ingamestats.timerDuration == -1 then
workspace.Lobby.GameInfo.SurfaceGui.Frame.TimeLeft.Percentage:TweenSize(UDim2.new(1
, 0, 1, 0), "Out", "Linear", 0, true)
else
workspace.Lobby.GameInfo.SurfaceGui.Frame.TimeLeft.Percentage.Size =
UDim2.new(1 - ((tick() - Ingamestats.timerStart) / Ingamestats.timerDuration), 0,
1, 0)
workspace.Lobby.GameInfo.SurfaceGui.Frame.TimeLeft.Percentage:TweenSize(UDim2.new(0
, 0, 1, 0), "Out", "Linear", Ingamestats.timerStart + Ingamestats.timerDuration -
tick(), true)
end
end)
UpdIngameStats:FireAllClients(Ingamestats)
end
spawn(function()
local srvtimeval =
ReplicatedStorage:WaitForChild("Flags"):WaitForChild("ServerTime")
while task.wait() do
srvtimeval.Value = tick()
end
end)
------------------------------------------------------------
local function UpdateCurPlaying(skip)
UpdIngameStatsFunc()
game.ServerStorage.Bindables.UpdIngamePlayerCount:Fire(#curPlaying)
if #curPlaying == 1 and not skip then
Sound:FireClient(curPlaying[1],1278127816,0.5,1.3)
Alert:FireClient(curPlaying[1],"You're the last player
alive!",Color3.fromRGB(192, 57, 43))
end
end
------------------------------------------------------------
local function UpdSpectateFired(player, pass)
--[[
if -PassKey ~= pass then
Alert:FireClient(player,"An error was occured. Reporting an error to
debugger...")
return
end
--]]
local SPCRETURN = {}
for i = 1, #curPlaying do
if player ~= curPlaying[i] then
table.insert(SPCRETURN, curPlaying[i])
end
end
return SPCRETURN, tick() - start
end
UpdSpectate.OnServerInvoke = UpdSpectateFired
------------------------------------------------------------
local function onReqPasskeyFired(player)
return PassKey
end
plrinfo:WaitForChild("Update"):WaitForChild("ShowInfo"):Fire(plr,MainData[plr.Name]
.plrData,false)
end)
end
function onCharacterLoaded(character)
local plr = getPlayerFromCharacter(character)
if MainData[plr.Name] and MainData[plr.Name].plrData and
MainData[plr.Name].plrData.equipped then
for tab, check in pairs(MainData[plr.Name].plrData.equipped) do
--[[local descendants = SF:GetDescendants()
for index, descendant in pairs(descendants) do
if descendant.Parent.Parent.Name == "Shop" then
if descendant.ID.Value == check then
Equipt(plr, descendant, true)
end
end
end]]
Equipt(plr, check, true)
end
end
end
for i,v in next,game:GetService('StarterGui'):GetChildren() do
v:Clone().Parent = ReplicatedStorage.GuiBackup
end
if normal == false then
local theme = Library.getThemeColor()
for i,v in next,script.MenuGui:GetDescendants() do
if v:IsA("TextButton") and v.Name == 'Close' then
v.BackgroundColor3 = theme
end
end
end
if ((not maptest) and game.PlaceId ~= 14442395477) and
script.MenuGui:FindFirstChild("MapTest") then
script.MenuGui.MapTest:Destroy()
end
--[[if game.GameId ~= 4989130044 and script.MenuGui:FindFirstChild("Admin") then
script.MenuGui.Admin:Destroy()
end]]
script.MenuGui:Clone().Parent = ReplicatedStorage.GuiBackup
game:GetService('Players').PlayerAdded:Connect(function(player)
script.MenuGui:Clone().Parent = player:WaitForChild("PlayerGui")
local firstset = false
player.CharacterAdded:Connect(function(character)
if firstset == false then
firstset = true
delay(5,function()
UpdIngameStats:FireClient(player,Ingamestats)
end)
end
character:WaitForChild("Humanoid").Died:Connect(function()
if player == nil then
return
end
local humRtPt = character:FindFirstChild("HumanoidRootPart")
local MapSpawn = workspace.Multiplayer:FindFirstChild("Map") and
workspace.Multiplayer.Map:FindFirstChild("Spawn")
local inspawn = false
local canauto = false
if table.find(curPlaying,player) then
canauto = true
end
if MapSpawn ~= nil then
if humRtPt ~= nil then
local min = MapSpawn.Position - (MapSpawn.Size * 0.5)
local max = MapSpawn.Position + (MapSpawn.Size * 0.5)
if humRtPt.Position.X >= min.X and humRtPt.Position.X
<= max.X and humRtPt.Position.Z >= min.Z and humRtPt.Position.Z <= max.Z then
inspawn = true
end
end
end
for i = 1, #Waiting do
if Waiting[i] == player then
table.remove(Waiting, i)
break
end
end
delay(game.Players.RespawnTime, function()
player:LoadCharacter()
if canauto == true and not inspawn then
wait()
if table.find(Waiting, player) then
return
end
table.insert(Waiting, player)
if voting then
ReplicatedStorage.Remote.NewMapVote:FireClient(player, voteStats)
end
local humRtPt = player.Character and
player.Character:FindFirstChild("HumanoidRootPart")
if humRtPt then
humRtPt.CFrame =
game.Workspace.Lobby.WaitingRegion.CFrame --
game.Workspace.Lobby.WaitingArea.WaitTeleport.CFrame
end
--
player.Character:MoveTo(game.Workspace.Lobby.WaitingRegion.Position)
end
end)
print("Summary:", plrSumData[player.Name])
pcall(function()
local Track =
MainData[player.Name].plrData.gameplayStats
if Track.mapBestTimes[map.MapInfo.Name]
~= nil then
if map.Survived.Time <
Track.mapBestTimes[map.MapInfo.Name] then
canChange = true;
end
else
canChange = true;
end
if canChange then
Track.mapBestTimes[map.MapInfo.Name] = map.Survived.Time
end
end)
else
addGameplayData.diedIngame += 1;
end
addGameplayData.mapsPlayed[Dif] += 1
addGameplayData.buttonsPressed += map.Buttons.Pressed
if MainData[player.Name].plrData.gameplayStats then
local tracker =
MainData[player.Name].plrData.gameplayStats
for o = 1, #curPlaying do
if curPlaying[o] == player then
table.remove(curPlaying, o)
UpdateCurPlaying()
if plrBtnData[player.Name] > 0 then
table.insert(plrSumData[player.Name]
[#plrSumData[player. Name]], {
"Button",
10,
plrBtnData[player.Name]
})
end
if plrGroupBtnData[player.Name] > 0 then
table.insert(plrSumData[player.Name]
[#plrSumData[player. Name]], {
"GroupButton",
20,
plrGroupBtnData[player.Name]
})
end
summary()
break
end
end
for o = 1, #Survivors do
if Survivors[o] == player then
table.remove(Survivors, o)
if plrBtnData[player.Name] > 0 then
table.insert(plrSumData[player.Name]
[#plrSumData[player. Name]], {
"Button",
10,
plrBtnData[player.Name]
})
end
if plrGroupBtnData[player.Name] > 0 then
table.insert(plrSumData[player.Name]
[#plrSumData[player. Name]], {
"GroupButton",
20,
plrGroupBtnData[player.Name]
})
end
summary()
break
end
end
end)
end)
end)
Players.PlayerAdded:Connect(onPlayerAdded)
--PlayerAdded.Event:Connect(onPlayerAdded)
local function OnPlayerRemove(player)
for o = 1, #curPlaying do
if curPlaying[o] == player then
table.remove(curPlaying, o)
UpdateCurPlaying()
end
end
for o = 1, #Survivors do
if Survivors[o] == player then
table.remove(Survivors, o)
UpdateCurPlaying()
end
end
MainData[player.Name].plrData.stats.lastLogin = os.date("*t")
local DSPD = DataStoreService:GetDataStore("PlayerData")
local success, err = pcall(function()
--if maptest then
-- return
--end
DSPD:SetAsync(player.UserId..Datastring, MainData[player.Name])
end)
if success then
print("Saved "..player.Name.."'s data")
else
warn("Cant save "..player.Name.."'s data :" ..err)
end
end
Players.PlayerRemoving:Connect(OnPlayerRemove)
ReqPasskey.OnServerInvoke = onReqPasskeyFired
------------------------------------------------------------
--[[StarterData = {
plrData = {
Banned = false,
BanReason = "",
stats = {
level = 1,
xp = 0,
lastLogin = {},
rebirth = 0,
consecutiveLogins = 0,
coins = 2,
gems = 0,
},
equipped = {
main = 0,
Abilities = 0,
Auras = 0,
Buddies = 0,
Codes = 0,
Currency = 0,
Emotes = 0,
Gamepasses = 0,
InsaneLock = 0,
Skins = 0,
Tanks = 0,
},
inventory = {
},
usedCodes = { --redeemed = {
},
options = Library.generateOptionsTab(),
gameplayStats = DataFormatting.setupGameplayTracking(),
dailyChallenges =
require(game.ServerScriptService.Misc.SV_DailyChallenges.ChallengeModule).newChalle
nges(),
boughtStarterPack = nil,
saveVersion = 0
},
}]]
ReqItemDataOLD.OnServerInvoke = onReqItemDataFired
MainData[player.Name].plrData.equipped.Auras = 0
if
player.Character.HumanoidRootPart:FindFirstChild(child.Name) then
player.Character.HumanoidRootPart:FindFirstChild(child.Name):Destroy()
end
UpdPlayerData:FireClient(player,
MainData[player.Name].plrData)
end
end
elseif descendant.Parent.Name == "Buddies" then
MainData[player.Name].plrData.equipped.Buddies = 0
if workspace.Buddies:FindFirstChild(player.Name ..
"_Buddy") then
workspace.Buddies:FindFirstChild(player.Name ..
"_Buddy"):Destroy()
end
UpdPlayerData:FireClient(player,
MainData[player.Name].plrData)
end
end
end
end
end
function GetitmTab(id)
for _, c in pairs(itemDataL) do
if c.ID == id then
return c
end
end
end
UpdPlayerData:FireClient(player, MainData[player.Name].plrData)
elseif itemdata.catagory == "Currency" then
game:GetService("MarketplaceService"):PromptProductPurchase(player,itemtab.ID)
elseif itemtab.catagory == "Gamepasses" and itemtab.currency == 2 then
game:GetService("MarketplaceService"):PromptGamePassPurchase(player,itemtab.ID)
end
else
--[[local descendants = SF:GetDescendants()
for index, descendant in pairs(descendants) do
if descendant.Parent.Parent.Name == "Shop" then
if descendant.ID.Value == SID then
Equipt(player, descendant)
end
end
end]]
Equipt(player, SID)
end
return true
end
ConfirmItem.OnServerEvent:Connect(ConfirmItemFired)
------------------------------------------------------------
local MarketplaceService = game:GetService("MarketplaceService")
CheckGamepassOwnership = function(player)
if PlrCaches[player.Name].OwnedGamepasses ~= nil then
return PlrCaches[player.Name].OwnedGamepasses
end
local owneds = {}
for i,v in pairs(itemDataL) do
if v and v.catagory == "Gamepasses" and v.ID then
if MarketplaceService:UserOwnsGamePassAsync(player.UserId, v.ID)
then
table.insert(owneds, v.ID)
end
end
end
PlrCaches[player.Name].OwnedGamepasses = owneds
return owneds
end
ReplicatedStorage.Remote.CheckGamepassOwnership.OnServerInvoke =
CheckGamepassOwnership
MarketplaceService.PromptGamePassPurchaseFinished:Connect(function(player,id,suc)
if suc == true and GetitmTab(id) then
ReplicatedStorage.Remote.UpdatedGamepassOwnership:FireClient(player,
{id})
end
end)
------------------------------------------------------------
local UpdOptions = ReplicatedStorage.Remote.UpdOptions
UpdOptions.OnServerEvent:Connect(function(player, option, key, isKey)
local MainPlr = MainData[player.Name]
local optionData = MainPlr.plrData.options
if isKey == 'Keybinds' then
if optionData.Keybinds[option] then
optionData.Keybinds[option].KeyString = key
end
else
if optionData['Main'] and optionData['Main'][option] then
local optionType = optionData['Main'][option].Property.Type
local oldValue = optionData['Main'][option].Property.Value
if optionType == 'boolean' then
optionData['Main'][option].Property.Value = not oldValue
elseif optionType == 'cycle' then
if oldValue >= #optionData['Main'][option].Property.Cycles
then
optionData['Main'][option].Property.Value = 1
else
optionData['Main'][option].Property.Value = oldValue
+ 1
end
end
end
end
UpdOptions:FireClient(player, MainPlr.plrData.options)
UpdPlayerData:FireClient(player, MainData[player.Name].plrData)
end)
------------------------------------------------------------
local function ReqVIPStatusFired(player, pass)
if -PassKey ~= pass then
Alert:FireClient(player,"An error was occured. Reporting an error to
debugger...")
return
end
return false
end
ReqVIPStatus.OnServerInvoke = ReqVIPStatusFired
--[[--------------------------------------------------------
local function ReqUserMapListFired(player)
return true
end
ReqUserMapList.OnServerInvoke = ReqUserMapListFired
------------------------------------------------------------
local function ReqTestMapFired(player)
return true
end
ReqTestMap.OnServerInvoke = ReqTestMapFired
--]]--------------------------------------------------------
local function ForceMapEventFired(player,key,ev)
if -PassKey ~= key then
Alert:FireClient(player,"An error was occured. Reporting an error to
debugger...")
return
end
forceevent = ev
--print("[TEST]: "..player.Name.." has forced map event to "..(ev or '*not
forced*'))
MapDebug:FireAllClients("Server: "..player.Name.." has forced map event to
"..(ev or '*not forced*'),BrickColor.new("White").Color)
end
ReplicatedStorage.Remote.TEST.ForceMapEvent.OnServerEvent:Connect(ForceMapEventFire
d)
------------------------------------------------------------
local function ReqAirToggleFired(player,key)
if -PassKey ~= key then
Alert:FireClient(player,"Anti-Exploit was triggered. Reporting to
moderator...")
return
end
game.ReplicatedStorage.Remote.TEST.AirToggle:FireClient(player)
end
ReqAirToggle.OnServerEvent:Connect(ReqAirToggleFired)
------------------------------------------------------------
local function ReqMapWhitelistFired(player)
return true
end
--ReqMapWhitelist.OnServerInvoke = ReqMapWhitelistFired
------------------------------------------------------------
local TeleportService = game:GetService("TeleportService")
ReqTele.OnServerEvent:Connect(function(player,id,uid)
Alert:FireClient(player,"Setting up teleport, Please wait...")
if id then
local success, errorMessage = pcall(function()
TeleportService:Teleport(id,player)
end)
if success then
else
Alert:FireClient(player,"Teleport failed, try again later.")
end
elseif uid then
local currentInstance, _, placeId, jobId
local success, errorMessage = pcall(function()
-- followId is the user ID of the player that you want to
retrieve the place and job ID for
currentInstance, _, placeId, jobId =
TeleportService:GetPlayerPlaceInstanceAsync(uid)
end)
if success then
-- Teleport player
local success, errorMessage = pcall(function()
TeleportService:TeleportToPlaceInstance(placeId, jobId,
player)
end)
if success then
else
Alert:FireClient(player,"Teleport failed, try again
later.")
end
else
Alert:FireClient(player,"Teleport failed, try again later.")
end
else
Alert:FireClient(player,"Teleport failed, try again later.")
end
end)
------------------------------------------------------------
--local rescuing = {}
local function
SurvivedFired(player,localplayer,key,air,exitRegion,exitRegPos,suvtime)
if -PassKey ~= key then
Alert:FireClient(player,"Illegally fired remote.")
return false
end
if player ~= localplayer then
Alert:FireClient(player,"Illegal player.")
return false
end
if air < 0 then
Alert:FireClient(player,"Illegal air value.")
return false
end
if exitRegion.Name ~= "ExitRegion" then
Alert:FireClient(player,"Illegal exitregion.")
return false
end
--[[if (not maptest) or exitRegion.Position ~= exitRegPos then
Alert:FireClient(player,"Illegal position.")
return false
end]]
local escapepos = #Survivors+1
table.insert(Survivors, player)
local Map = workspace.Multiplayer:WaitForChild("Map")
local difval = Map.Settings:FindFirstChild("Difficulty") and
Map.Settings.Difficulty.Value or Map.Settings:GetAttribute("Difficulty")
local diftext = tabDif[difval]
if diftext == nil then
diftext = "Unknown"
end
local difxp = SumDifVal[difval]
if difxp == nil then
difxp = 10
end
if MapInitModule.isRescuing(player) then
local togive = 1
if CurDif >= 3 then
togive = 2
end
Alert:FireClient(player,"✅ Rescue Complete! +"..togive.." Gem" ..
(togive == 1 and '' or "s"),Color3.fromRGB(241, 219, 128),nil,'event')
Sound:FireClient(player,983016958,0.5,1.35)
MainData[player.Name].plrData.stats.gems =
MainData[player.Name].plrData.stats.gems + togive
UpdPlayerData:FireClient(player, MainData[player.Name].plrData)
RescueTrigger:FireClient(player,nil,true)
plrSumData[player.Name][#plrSumData[player.Name]].Rescue = {
Reward = togive
}
end
--Alert:FireClient(player, "You Survived!", Color3.new(0, 1, 0))
Alert:FireClient(player,'Escaped ' ..
tostring(Map.Settings:FindFirstChild("MapName") and Map.Settings.MapName.Value or
Map.Settings:GetAttribute("MapName")) ..' (#' .. escapepos .. '): ' .. difxp .. '
XP', Color3.new(0.945098, 0.858824, 0.501961))
table.insert(plrSumData[player.Name][#plrSumData[player. Name]], {
"Button",
10,
plrBtnData[player.Name]
})
table.insert(plrSumData[player.Name][#plrSumData[player. Name]], {
"GroupButton",
20,
plrGroupBtnData[player.Name]
})
plrSumData[player.Name][#plrSumData[player.Name]].Buttons.Pressed =
plrBtnData[player.Name] + plrGroupBtnData[player.Name]
plrBtnData[player.Name] = 0
plrGroupBtnData[player.Name] = 0
table.insert(plrSumData[player.Name][#plrSumData[player.Name]], {
"Survived "..diftext,
difxp
})
if PAS == 1 then
table.insert(plrSumData[player.Name][#plrSumData[player.Name]], {
"Solo Survival",
40
})
end
plrSumData[player.Name][#plrSumData[player.Name]].Survived = {
Position = escapepos,
AllPlayers = PAS,
Time = suvtime
}
plrSumData[player.Name][#plrSumData[player.Name]].Difficulty = difval
for i = 1, #curPlaying do
if curPlaying[i] == player then
table.remove(curPlaying, i)
end
end
if player.Character:FindFirstChild("PlrInfo") then
player.Character.PlrInfo.Update.ShowInfo:Fire(player,MainData[player.Name].plrData,
false)
end
return true
end
Survived.OnServerInvoke = SurvivedFired
------------------------------------------------------------
game.Workspace.Multiplayer.PlayingBGM.BGMTime.OnServerInvoke = function(player)
if start ~= nil then
local gottime = tick() - start
if workspace.Multiplayer:FindFirstChild("Map") then
if workspace.Multiplayer.Map:FindFirstChild("Settings") then
if
workspace.Multiplayer.Map.Settings:FindFirstChild("DelayBGM") then
if workspace.Multiplayer.Map.Settings.DelayBGM.Value
== true then
gottime = gottime + 1
end
elseif
workspace.Multiplayer.Map.Settings:GetAttribute("DelayBGM") == true then
gottime = gottime + 1
end
end
end
return gottime
else
return 0
end
end
------------------------------------------------------------
local nextmap = nil
local mapIDs = {}
}
end]]
local loadedmaps = {}
if unloaded == true then
for i,v in pairs(game.ServerStorage.UnloadedMaps:GetChildren()) do
if v:FindFirstChild("Settings") then
local settingss = {}
settingss.MapName = v.Settings:FindFirstChild("MapName")
and v.Settings.MapName.Value or v.Settings:GetAttribute("MapName") or ''
settingss.Difficulty =
v.Settings:FindFirstChild("Difficulty") and v.Settings.Difficulty.Value or
v.Settings:GetAttribute("Difficulty") or ''
settingss.MapImage = v.Settings:FindFirstChild("MapImage")
and v.Settings.MapImage.Value or v.Settings:GetAttribute("MapImage") or 0
settingss.Creator = v.Settings:FindFirstChild("Creator")
and v.Settings.Creator.Value or v.Settings:GetAttribute("Creator") or ''
settingss.specialMapName = nil
settingss.specialMapColor = nil
settingss.specialMap =
(v.Settings:FindFirstChild("Highlight") and v.Settings.Highlight.Value) or
v.Settings:GetAttribute("Highlight") or (v.Settings:FindFirstChild("Seasonal") and
v.Settings.Seasonal.Value) or v.Settings:GetAttribute("Seasonal") or false
local SpecialMapsVars = {
"Highlight",
"Seasonal"
}
local SpecialMaps = {
"Featured Map",
"Seasonal Map"
}
local SpecialMapsColors = {
Color3.fromRGB(85, 170, 127),
Color3.fromRGB(166, 231, 255)
}
if settingss.specialMap then
for k, u in next, SpecialMapsVars do
if (v.Settings:FindFirstChild(u) and
v.Settings[u].Value) or v.Settings:GetAttribute(u) then
settingss.specialMapName = SpecialMaps[k]
settingss.specialMapColor =
SpecialMapsColors[k]
end
end
end
local SpecialMapsVars = {
"Highlight",
"Seasonal"
}
local SpecialMaps = {
"Featured Map",
"Seasonal Map"
}
local SpecialMapsColors = {
Color3.fromRGB(85, 170, 127),
Color3.fromRGB(166, 231, 255)
}
if settingss.specialMap then
for k, u in next, SpecialMapsVars do
if (v.Settings:FindFirstChild(u) and
v.Settings[u].Value) or v.Settings:GetAttribute(u) then
settingss.specialMapName = SpecialMaps[k]
settingss.specialMapColor =
SpecialMapsColors[k]
end
end
end
local SpecialMapsVars = {
"Highlight",
"Seasonal"
}
local SpecialMaps = {
"Featured Map",
"Seasonal Map"
}
local SpecialMapsColors = {
Color3.fromRGB(85, 170, 127),
Color3.fromRGB(166, 231, 255)
}
if settingss.specialMap then
for k, u in next, SpecialMapsVars do
if (v.Settings:FindFirstChild(u) and
v.Settings[u].Value) or v.Settings:GetAttribute(u) then
settingss.specialMapName = SpecialMaps[k]
settingss.specialMapColor =
SpecialMapsColors[k]
end
end
end
ReqLoadedMaps.OnServerInvoke = ReqLoadedMapsFired
MapStorage.ChildAdded:Connect(function(c)
RefreshMaps(true)
UpdMapListPart(c)
end)
MapStorage.ChildRemoved:Connect(function(c)
--pcall(removeMapVoteInfo, c)
RefreshMaps(true)
UpdMapListPart(c)
end)
RefreshMaps()
--------------------------------Vote-
ReplicatedStorage.Remote.UpdMapVote.OnServerEvent:Connect(function(player, key,
mapID, cost)
if -PassKey ~= key then
Alert:FireClient(player,"An error was occured. Reporting an error to
debugger...")
return
end
local votedMap = nil
for i,v in next,voteStats.mapData do
if v.ID == mapID then
votedMap = v
break
end
end
if votedMap == nil then return end
if voteStats.pVotes[tostring(player.UserId)] == nil then
voteStats.pVotes[tostring(player.UserId)] = {
mapID = mapID,
voteCount = 0,
votes = 0
}
end
local passes = CheckGamepassOwnership(player)
local allMapsAccess = passes and (table.find(passes, 14122753) ~= nil) or
false --change to real id: 14112023
local pVote = voteStats.pVotes[tostring(player.UserId)]
local actualCost = votedMap.locked == true and (allMapsAccess and 0 or
(votedMap.unlockCost or (pVote.voteCount == 0 and 0 or ((votedMap.extraVoteCost or
0) + (pVote.voteCount - 1) * 10)))) or (pVote.voteCount == 0 and 0 or
((votedMap.extraVoteCost or 0) + (pVote.voteCount - 1) * 10))
if cost == actualCost then
if MainData[player.Name].plrData.stats.coins >= actualCost then
MainData[player.Name].plrData.stats.coins =
MainData[player.Name].plrData.stats.coins - actualCost
votedMap.locked = false
pVote.votes = pVote.votes + 1
pVote.voteCount = pVote.votes * (allMapsAccess and (maptest and 4
or 2) or 1)
ReplicatedStorage.Remote.UpdMapVote:FireAllClients(voteStats)
UpdPlayerData:FireClient(player, MainData[player.Name].plrData)
votedFirst = true
end
else
Alert:FireClient(player, "Failed to confirm vote cost")
end
end)
--Adds-------------------------------
local function RemoveLoadedMapFired(player,ins,load)
if voting == true then
MapDebug:FireClient(player,"Map is voting! Cancelled map remove.",
Color3.new(1,0,0))
return
end
if game.GameId ~= 4989130044 and maptest then
if #MapStorage:GetChildren() <= 1 then
pcall(function()
MapDebug:FireClient(player,"There must be at least one
map.",Color3.new(1,0,0))
end)
return
end
pcall(function()
MapDebug:FireAllClients(player.Name.." has removed the map: "..(
ins.Value.Settings:FindFirstChild("MapName")
and ins.Value.Settings.MapName.Value
or ins.Value.Settings:GetAttribute("MapName")
),BrickColor.new("White").Color)
end)
if nextmap == ins.Value then
nextmap = nil
pcall(function()
MapDebug:FireAllClients("Server: Next map is not overridden
now.")
end)
end
ins.Value:Destroy()
return
end
if load == true then
ins.Value.Parent = MapStorage
pcall(function()
MapDebug:FireAllClients("Server: "..player.Name.." has loaded the
map: "..(
ins.Value.Settings:FindFirstChild("MapName")
and ins.Value.Settings.MapName.Value
or ins.Value.Settings:GetAttribute("MapName")
),BrickColor.new("White").Color)
end)
else
ins.Value.Parent = game.ServerStorage.UnloadedMaps
pcall(function()
MapDebug:FireAllClients("Server: "..player.Name.." has unloaded
the map: "..(
ins.Value.Settings:FindFirstChild("MapName")
and ins.Value.Settings.MapName.Value
or ins.Value.Settings:GetAttribute("MapName")
),BrickColor.new("White").Color)
end)
end
end
RemoveLoadedMap.OnServerEvent:Connect(RemoveLoadedMapFired)
AddedWaiting.OnServerEvent:Connect(AddedWaitingFired)
-----------------------------------------------------------
RemoveWaiting.OnServerEvent:Connect(RemoveWaitingFired)
-----------------------------------------------------------
local function ReqRebirthFired(player)
if MainData[player.Name].plrData.stats.level >= 100 and
MainData[player.Name].plrData.stats.xp >= 12000 and
MainData[player.Name].plrData.stats.rebirth < 10 then
LvlUp:FireClient(player, 5)
MainData[player.Name].plrData.stats.gems =
MainData[player.Name].plrData.stats.gems + 5
MainData[player.Name].plrData.stats.xp = 0
MainData[player.Name].plrData.stats.level = 1
MainData[player.Name].plrData.stats.rebirth =
MainData[player.Name].plrData.stats.rebirth + 1
UpdPlayerData:FireClient(player, MainData[player.Name].plrData)
end
end
ReqRebirth.OnServerEvent:Connect(ReqRebirthFired)
------------------------------------------------------------
function Givexp(player, xp)
local DateVal = os.date("*t")
local ATLeaderStore =
DataStoreService:GetOrderedDataStore(LBString.."ATLeaderStore")
local CMLeaderStore =
DataStoreService:GetOrderedDataStore(LBString.."CMLeaderStore"..MonthNames[DateVal.
month]..DateVal.year)
MainData[player.Name].plrData.stats.xp =
MainData[player.Name].plrData.stats.xp + xp
MainData[player.Name].plrData.stats.coins =
MainData[player.Name].plrData.stats.coins + Library.getXPCoinAward(xp)
MainData[player.Name].plrData.stats.gems =
MainData[player.Name].plrData.stats.gems + Library.getXPGemAward(xp)
if MainData[player.Name].plrData.stats.xp >=
Library.calcLevelXP(MainData[player.Name].plrData.stats.level) then
repeat
MainData[player.Name].plrData.stats.xp =
MainData[player.Name].plrData.stats.xp -
Library.calcLevelXP(MainData[player.Name].plrData.stats.level)
MainData[player.Name].plrData.stats.level =
MainData[player.Name].plrData.stats.level + 1
until MainData[player.Name].plrData.stats.xp <
Library.calcLevelXP(MainData[player.Name].plrData.stats.level)
LvlUp:FireClient(player, 5)
MainData[player.Name].plrData.stats.gems =
MainData[player.Name].plrData.stats.gems + 5
if MainData[player.Name].plrData.stats.level >= 100 then
MainData[player.Name].plrData.stats.xp = Library.calcLevelXP(100)
end
end
UpdPlayerData:FireClient(player, MainData[player.Name].plrData)
local success, pages = pcall(function()
return ATLeaderStore:GetAsync(player.Name)
end)
if success then
if pages then
local success = pcall(function()
--[[if game.GameId ~= 15016276688 and maptest then
return
end]]
ATLeaderStore:IncrementAsync(player.Name,xp)
end)
else
local success = pcall(function()
--[[if game.GameId ~= 15016276688 and maptest then
return
end]]
ATLeaderStore:SetAsync(player.Name,xp)
end)
end
else
warn("Error getting Cur month leader store for "..player.Name)
end
local success, pages = pcall(function()
return CMLeaderStore:GetAsync(player.Name)
end)
if success then
if pages then
local success = pcall(function()
--[[if game.GameId ~= 15016276688 and maptest then
return
end]]
CMLeaderStore:IncrementAsync(player.Name,xp)
end)
else
local success = pcall(function()
--[[if game.GameId ~= 15016276688 and maptest then
return
end]]
CMLeaderStore:SetAsync(player.Name,xp)
end)
end
else
warn("Error getting All time leader store for "..player.Name)
end
end
game.ServerStorage.Bindables.AwardTrophy.Event:Connect(function(player, trophyId,
rank)
local pData = MainData[player.Name]
if pData then
--Check if already own trophy
local ownsItem
for _, c in pairs(pData.plrData.inventory) do
if c == trophyId then
ownsItem = true
break
end
end
workspace.Lobby.GameInfo.SurfaceGui.Frame.Difficulty.LockedUI.Visible = true
workspace.Lobby.GameInfo.SurfaceGui.Frame.Difficulty.Locked.Visible = true
workspace.Lobby.GameInfo.SurfaceGui.Frame.Difficulty.Difficulty.Size =
UDim2.new(0.83, 0, 1, 0)
workspace.Lobby.GameInfo.SurfaceGui.Frame.Difficulty.LockedUI.Arrow.ImageColor3 =
difColors[LockedCurDif + 1]
workspace.Lobby.GameInfo.SurfaceGui.Frame.Difficulty.Locked.Amount.Text =
LockedCurDifLeft
UpdPlayerData:FireClient(player, MainData[player.Name].plrData)
Alert:FireAllClients(player.Name.." has locked the lift to
Insane!", Color3.fromRGB(170, 85, 255), false, false)
UpdIngameStatsFunc()
else
Alert:FireClient(player, "You don't have enough Gems!")
end
elseif mode == 2 then
if MainData[player.Name].plrData.stats.gems >= 25 then
MainData[player.Name].plrData.stats.gems =
MainData[player.Name].plrData.stats.gems - 25
Sound:FireAllClients(1044088048, 5)
LockedCurDif = 4
LockedCurDifLeft = 1
lockcounted = false
workspace.Lobby.GameInfo.SurfaceGui.Frame.Difficulty.LockedUI.Visible = true
workspace.Lobby.GameInfo.SurfaceGui.Frame.Difficulty.Locked.Visible = true
workspace.Lobby.GameInfo.SurfaceGui.Frame.Difficulty.Difficulty.Size =
UDim2.new(0.83, 0, 1, 0)
workspace.Lobby.GameInfo.SurfaceGui.Frame.Difficulty.LockedUI.Arrow.ImageColor3 =
difColors[LockedCurDif + 1]
workspace.Lobby.GameInfo.SurfaceGui.Frame.Difficulty.Locked.Amount.Text =
LockedCurDifLeft
UpdPlayerData:FireClient(player, MainData[player.Name].plrData)
Alert:FireAllClients(player.Name.." has locked the lift to
Crazy!", Color3.fromRGB(215, 131, 59), false, false)
UpdIngameStatsFunc()
else
Alert:FireClient(player, "You don't have enough Gems!")
end
elseif mode == 3 then
if MainData[player.Name].plrData.stats.gems >= 50 then
MainData[player.Name].plrData.stats.gems =
MainData[player.Name].plrData.stats.gems - 50
Sound:FireAllClients(1044088048, 5)
LockedCurDif = 5
LockedCurDifLeft = 3
lockcounted = false
workspace.Lobby.GameInfo.SurfaceGui.Frame.Difficulty.LockedUI.Visible = true
workspace.Lobby.GameInfo.SurfaceGui.Frame.Difficulty.Locked.Visible = true
workspace.Lobby.GameInfo.SurfaceGui.Frame.Difficulty.Difficulty.Size =
UDim2.new(0.83, 0, 1, 0)
workspace.Lobby.GameInfo.SurfaceGui.Frame.Difficulty.LockedUI.Arrow.ImageColor3 =
difColors[LockedCurDif + 1]
workspace.Lobby.GameInfo.SurfaceGui.Frame.Difficulty.Locked.Amount.Text =
LockedCurDifLeft
UpdPlayerData:FireClient(player, MainData[player.Name].plrData)
Alert:FireAllClients(player.Name.." has locked the lift to
CRAZY+!", Color3.fromRGB(211, 84, 0), false, false)
UpdIngameStatsFunc()
else
Alert:FireClient(player, "You don't have enough Gems!")
end
end
end]]
local function BuyDifLockFired(player, mode)
if LockedCurDif > 0 then
Alert:FireClient(player, "Lift already locked!")
return
end
Alert:FireClient(player, "Pro Lock is temporality disabled for Intensity
Update.", Color3.new(1,.5))
end
BuyDifLock.OnServerEvent:Connect(BuyDifLockFired)
------------------------------------------------------------
local boostCosts = (not chaos) and {
5, -- 1. +0.5
9, -- 2. final: +1.0
16, -- 3. final: +1.5
28, -- 4. final: +2.0
49, -- 5. final: +2.5
98, -- 6. final: +3.0
--[[196, --test
392, --test
784, --test
1568, --test
3136, --test
6272, --test
945534534e5568156, --test]]--cursed enough
} or {5,10,15,20,25,30}
local boostCount = 0
function ClearBoostStats()
BoostedIntensity = 0
boostCount = 0
Ingamestats.intBoostCurrentCost = boostCosts[boostCount+1]
end
ReplicatedStorage.Remote.BoostIntensity.OnServerEvent:Connect(function(player,
agreed)
if Ingamestats.boostingEnabled == false then
return
end
if boostCosts[boostCount+1] == nil then
return
end
if Intensity+getIntensityChange(0,Intensity,BoostedIntensity) >= 6.99 then
return
end
local boostCost = boostCosts[boostCount+1]
if (not agreed) and boostCount > 1 then
ReplicatedStorage.Remote.BoostIntensity:FireClient(player, "The current
intensity boost is ".. BoostedIntensity ..". Boosting by another 0.5 will cost "..
boostCost .." Gems.", "Intensity Boost", true)
return
end
if MainData[player.Name].plrData.stats.gems >= boostCost then
MainData[player.Name].plrData.stats.gems =
MainData[player.Name].plrData.stats.gems - boostCost
UpdPlayerData:FireClient(player, MainData[player.Name].plrData)
boostCount = boostCount + 1
Ingamestats.intBoostCurrentCost = boostCosts[boostCount+1] or "Max"
if boostCosts[boostCount+1] == nil then
Ingamestats.boostingEnabled = false
end
BoostedIntensity = BoostedIntensity + (chaos and 1 or 0.5)
UpdIngameStatsFunc()
local minInt =
math.clamp(Intensity+getIntensityChange(0,Intensity,BoostedIntensity),1,6.99)
Alert:FireAllClients((player.Name .. " boosted! Min. Intensity: %.2f -
%.2f"):format(minInt,
math.clamp(Intensity+getIntensityChange(1,Intensity,BoostedIntensity),1,6.99)),
difColors[math.floor(minInt)] or nil, nil, minInt >= 6.99 and 'rainbow' or nil)
Sound:FireAllClients(1044088048, 5, 1 + (0.05 * boostCount))
else
return
end
end)
------------------------------------------------------------
local function ExitTitleFired(player)
player:LoadCharacter()
end
ExitTitle.OnServerEvent:Connect(ExitTitleFired)
------------------------------------------------------------
LoadedMap.OnServerEvent:Connect(function(player)
--local done = false
for i = 1, #NWaiting do
if NWaiting[i] == player then
--done = true
table.insert(Loaded, player)
UpdLoadScreen:FireClient(player, loadingmsg)
if playing == true then
player.Character.HumanoidRootPart.Anchored = false
end
return
end
end
for i = 1, #curPlaying do
if curPlaying[i] == player then
--done = true
table.insert(Loaded, player)
UpdLoadScreen:FireClient(player, loadingmsg)
if playing == true then
player.Character.HumanoidRootPart.Anchored = false
end
return
end
end
end)
ReplicatedStorage.Remote.MapHistory.OnInvoke = function()
return playeds
end
Codes = require(script:WaitForChild("Codes"))
table.insert(MainData[player.Name].plrData.inventory,
(#MainData[player.Name].plrData.inventory + 1),v.id)
pcall(function()
Notify:FireClient(player,"You have
been awarded with " .. GetitmTab(v.id).name .. "!", "Item Awarded")
end)
end
end
end
end
end
Givexp(player,Codes.codes[code].xp or 0)
table.insert(MainData[player.Name].plrData.usedCodes, code) --
redeemed[code] = true
UpdPlayerData:FireClient(player, MainData[player.Name].plrData)
--Alert:FireClient(player,codes[code].msg)
Alert:FireClient(player,Codes.codes[code].msg or "Code Accepted!")
--return codes[code].msg
return Codes.codes[code].msg or "Code Accepted!"
elseif Codes.expired[code] then
Alert:FireClient(player,"Invalid Code! (Expired)")
return "Invalid Code! (Expired)"
else
Alert:FireClient(player,"Invalid Code!")
return "Invalid Code!"
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 IsButton(object)
assert(typeof(object) == "Instance")
game.ServerStorage.Bindables.GetPlaying.OnInvoke = function()
return curPlaying
end
GetMapVals.OnInvoke = GepMapValsFunc
Winsinrow = 0
workspace.Lobby.GameInfo.SurfaceGui.Frame.Difficulty.LockedUI.Visible = false
workspace.Lobby.GameInfo.SurfaceGui.Frame.Difficulty.Locked.Visible = false
workspace.Lobby.GameInfo.SurfaceGui.Frame.Difficulty.Difficulty.Size =
UDim2.new(1, 0, 1, 0)
LockedCurDif = 0
LockedCurDifLeft = 0
else
workspace.Lobby.GameInfo.SurfaceGui.Frame.Difficulty.LockedUI.Visible = true
workspace.Lobby.GameInfo.SurfaceGui.Frame.Difficulty.Locked.Visible = true
workspace.Lobby.GameInfo.SurfaceGui.Frame.Difficulty.Difficulty.Size =
UDim2.new(0.83, 0, 1, 0)
workspace.Lobby.GameInfo.SurfaceGui.Frame.Difficulty.LockedUI.Arrow.ImageColor3 =
difColors[LockedCurDif]
workspace.Lobby.GameInfo.SurfaceGui.Frame.Difficulty.Locked.Amount.Text =
LockedCurDifLeft
LockedCurDifLeft = LockedCurDifLeft - 1
if CurDif < LockedCurDif then
CurDif = LockedCurDif
end
if LockedCurDif == 5 then
Winsinrow = 0
CurDif = 5
SpcRnd = true
end
end
end
end
end)
function NearestValue(table, number)
local smallestSoFar, smallestIndex
smallestSoFar = nil
smallestIndex = nil
for i, y in ipairs(table) do
if not smallestSoFar or (math.abs(number-y) < smallestSoFar) then
smallestSoFar = math.abs(number-y)
smallestIndex = i
end
end
return smallestIndex, table[smallestIndex]
end
game.ServerStorage.Bindables.BtnPressXP.Event:Connect(function(player,btnid,isgroup
,isexplosive)
local xp = isgroup and 20 or 10
if isgroup then
plrGroupBtnData[player.Name] += 1
else
plrBtnData[player.Name] += 1
end
Alert:FireClient(player,'Pressed Button #'..btnid..': '..xp..'XP',
Color3.new(0.945098, 0.858824, 0.501961))
if workspace.Multiplayer:FindFirstChild("Map") and
workspace.Multiplayer.Map:FindFirstChild("Timeline_Wrapper") and
workspace.Multiplayer.Map.Timeline_Wrapper:IsA("Script") then
-- handles timelines sound (already there in mapinitmodule)
else
Sound:FireClient(player,1523860403,0.5,1.35)
end
end)
game.ServerStorage.Bindables.UpdButtonCount.Event:Connect(function(count)
Ingamestats.currentButton = (count ~= 0) and (count - 1) or
Ingamestats.totalButtons
UpdIngameStatsFunc()
end)
game.ServerStorage.Bindables.EnableAndGetExitRegions.OnInvoke = function()
Ingamestats.currentButton = 0
UpdIngameStatsFunc()
return exit
end
game.ServerStorage.Bindables.GetPlayerGameState.OnInvoke = function(player)
if table.find(curPlaying,player) then
return 'playing'
elseif table.find(Survivors,player) then
return 'survived'
else
return 'lobby'
end
end
ReplicatedStorage.Remote.ReqLostPages.OnServerInvoke = function(player, target)
return {} --wip
end
game.ServerStorage.Bindables.LostPageCollected.Event:Connect(function(player,id,par
t)
table.insert(plrSumData[player.Name][#plrSumData[player.Name]], {
"LostPage",
50,
1
})
end)
game.ServerStorage.Bindables.ReqIngamePlayerCount.OnInvoke = function()
return #curPlaying
end
ReplicatedStorage.Remote.PressedMapButton.OnServerEvent:Connect(function(plr,hit)
MapInitModule.serverButtonPressed(plr,hit)
end)
while wait() do
if #Waiting > 0 and Playing == false or playeda == true then
Ingamestats.gameStatus = "intermission"
Ingamestats.timerStart = tick()
Ingamestats.timerDuration = waitingtime
Ingamestats.boostingEnabled = false
if maptest and #game:GetService("Players"):GetPlayers() <= 1 and false
then
Ingamestats.timerDuration = 1
end
UpdIngameStatsFunc()
--
workspace.Lobby.GameInfo.SurfaceGui.Frame.TimeLeft.Percentage:TweenSize(UDim2.new(0
, 0, 1, 0), nil, "Linear", maptest and 5 or waitingtime, true)
local mok = {}
--if Maps[0][1] ~= nil then mok[#mok+1] = 0 end
for i = 1,#Maps do
if #Maps[i] ~= 0 then mok[#mok+1] = i end
end
local confirmDif = ActualDif(Intensity)
if table.find(mok, confirmDif) then
startNewVote(confirmDif)
else
local dok = mok if table.find(dok,PlayedDif) then
pcall(function() dok:remove(table.find(dok,PlayedDif)) end) if dok[1] == nil then
dok = mok end end
local i,val
local suc,err = pcall(function()
i,val = NearestValue(dok,confirmDif)
end)
if val ~= nil then
startNewVote(val)
else
Waiting = NWaiting
NWaiting = {}
Playing = false
game.ReplicatedStorage.Remote.Alert:FireAllClients("Unable
to start the game. Please rejoin.",Color3.fromRGB(255,0,0))
continue -- Luau statement
end
end
local liftwait = tick()
repeat task.wait()
if #game:GetService("Players"):GetPlayers() <= 1 and ((voting ==
false) or (votedFirst == true)) then
Ingamestats.timerDuration = 1 -- // break lift waits once
player voted map, or only one map installed, on solo server
UpdIngameStatsFunc() --NOTE IT IS THE RIGHT SCRIPT THAT
MAKES UH YOU UNDERSTOOD
end
until tick() - liftwait > Ingamestats.timerDuration
ReplicatedStorage.Remote.UpdMapVote:FireAllClients()
if workspace.Multiplayer:FindFirstChild("Map") then
--ropesdata = {}
if script.Parent:FindFirstChild("EvtString_Active") then
script.Parent:FindFirstChild("EvtString_Active"):Destroy()
end
workspace.Multiplayer:FindFirstChild("Map"):Destroy()
end
if #Waiting > 0 then
UpdIngameStatsFunc()
--[[if Winsinrow >= 3 then
--Winsinrow = 0
CurDif = 4
SpcRnd = true
elseif Winsinrow >= 4 then
Winsinrow = 0
CurDif = 4
SpcRnd = true
end]]
CurDif = math.clamp(math.floor(Intensity),1,6) - 1
NWaiting = Waiting
Waiting = {}
Loaded = {}
curPlaying = {}
Survivors = {}
UpdLoading("Waiting for Server")
playeda = true
abc = false
local Mapss = Maps[confirmDif] --[CurDif]
local plsmapr = false
if Mapss and Mapss[1] == nil then
for i,v in pairs(Maps) do
if v[1] ~= nil then
plsmapr = true
Mapss = v
end
end
elseif not Mapss then
warn("Reached to impossible area, it may occur some
error.")
end
local counts = #MapStorage:GetChildren()
if counts <= 0 then
Playing = false
curPlaying = {}
NWaiting = {}
playeda = false
Alert:FireAllClients(":( The game cannot start. There are
no maps.",Color3.fromRGB(255,0,0))
continue -- Luau statement
end
local rand = nil
local selmap = nil
selmap = pickMap()
if nextmap ~= nil then
selmap = nextmap
if nextmap:FindFirstChild("Settings") then
if nextmap.Settings:FindFirstChild("Difficulty") then
--CurDif =
math.clamp(nextmap.Settings.Difficulty.Value,1,6) - 1
elseif nextmap.Settings:GetAttribute("Difficulty")
then
--CurDif =
math.clamp(nextmap.Settings:GetAttribute("Difficulty"),1,6) - 1
end
--Intensity = CurDif + 1
end
nextmap = nil
RefreshMaps(true)
UpdMapListPart(selmap)
Alert:FireAllClients("The map has been overridden by
privileged player(s).")
end
ReplicatedStorage.Remote.MapHistory.NewMap:Fire(selmap)
if selmap ~= nil and selmap:FindFirstChild("Settings") then
if selmap.Settings:FindFirstChild("Difficulty") then
if type(tonumber(selmap.Settings.Difficulty.Value))
== "number" then
PlayedDif =
math.clamp(tonumber(selmap.Settings.Difficulty.Value),1,6)
end
elseif selmap.Settings:GetAttribute("Difficulty") then
if
type(tonumber(selmap.Settings:GetAttribute("Difficulty"))) == "number" then
PlayedDif =
math.clamp(tonumber(selmap.Settings:GetAttribute("Difficulty")),1,6)
end
end
end
table.insert(playeds,(#playeds+1),selmap)
local Map = selmap:Clone()
local enablethis = {}
for i,v in ipairs(selmap:GetDescendants()) do
if v:IsA("Script") and v.Disabled == false then
if v.Name ~= "EventScript" then
table.insert(enablethis,(#enablethis+1),v)
end
v.Disabled = true
end
end
local mapinfos = {
Name = Map.Settings:GetAttribute("MapName") or
(Map.Settings:FindFirstChild("MapName") and Map.Settings.MapName.Value) or '',
Difficulty =
math.clamp(tonumber(Map.Settings:GetAttribute("Difficulty")) or
tonumber(Map.Settings:FindFirstChild("Difficulty") and
Map.Settings.Difficulty.Value) or 6,1,6),
Rate = Map.Settings:GetAttribute("Difficulty") or
(Map.Settings:FindFirstChild("Difficulty") and Map.Settings.Difficulty.Value) or "-
1.0",
Creator = Map.Settings:GetAttribute("Creator") or
(Map.Settings:FindFirstChild("Creator") and Map.Settings.Creator.Value) or '',
ImgID = Map.Settings:GetAttribute("MapImage") or
(Map.Settings:FindFirstChild("MapImage") and Map.Settings.MapImage.Value) or 0,
ButtonCount = #GetButtons(Map),
assetCount = Map.Settings:GetAttribute("AssetCount") or
countParts(Map),
highlight = Map.Settings:GetAttribute("Highlight") or
(Map.Settings:FindFirstChild("Highlight") and Map.Settings.Highlight.Value) or
false,
mapID = maptest and (Map.Settings:GetAttribute("MapID") or
(Map.Settings:FindFirstChild("MapID") and Map.Settings.MapID.Value) or '0') or nil
}
Ingamestats.mapName = mapinfos.Name
Ingamestats.mapImg = mapinfos.ImgID
Ingamestats.difficulty = ActualDif(Intensity) --
mapinfos.Difficulty
Ingamestats.intensity = Intensity --mapinfos.Difficulty
--wait(1)
exit = Map:FindFirstChild("ExitRegion", true)
if exit == nil then
for i = 1,#curPlaying do
if curPlaying[i] ~= nil then
Alert:FireClient(curPlaying[i],"An error
occured while loading map.")
warn("The map has no ExitRegion. Skipped.") --
new debug
if curPlaying[i].Character ~= nil then
curPlaying[i].Character.Humanoid.Health =
0
end
end
end
Playing = false
playeda = false
NWaiting = {}
curPlaying = {}
--
workspace.Lobby.GameInfo.SurfaceGui.Frame.TimeLeft.Percentage:TweenSize(UDim2.new(1
, 0, 1, 0), nil, "Linear", 0, true)
continue
end
if workspace.Multiplayer:FindFirstChild("Map") then
--ropesdata = {}
workspace.Multiplayer:FindFirstChild("Map"):Destroy()
if script.Parent:FindFirstChild("Timelines") then
script.Parent.Timelines:Destroy()
end
end
--wait(1) --makes players wait 1 second before loading starts
for i = 1, #NWaiting do
UpdateGameState:FireClient(NWaiting[i], "loading",
mapinfos, Winsinrow + 1)
end
local event,forcedmirror = nil,nil
if forceevent ~= nil then
event,forcedmirror = MapInitModule.pickEvent(Map,forceevent
~= "none" and forceevent or nil)
elseif math.random(1,2) == 1 then
event,forcedmirror = MapInitModule.pickEvent(Map,true)
end
wait() --note set to 1 to make loading not instant
local lastBtnId = 1
while true do
local btn = Map:findFirstChild("_Button" .. lastBtnId,
true)
if btn then
lastBtnId = lastBtnId + 1
end
if not btn then
break
end
end
Ingamestats.totalButtons = lastBtnId
--workspace.Multiplayer:FindFirstChild("NewMap").Name = "Map"
local xmin,xmax = Map.Spawn.Position.X - (Map.Spawn.Size.X/2 *
0.8), Map.Spawn.Position.X + (Map.Spawn.Size.X/2 * 0.8)
local zmin,zmax = Map.Spawn.Position.Z - (Map.Spawn.Size.Z/2 *
0.8), Map.Spawn.Position.Z + (Map.Spawn.Size.Z/2 * 0.8)
for i = 1, #NWaiting do
if NWaiting[i] ~= nil and NWaiting[i].Character ~= nil then
game:GetService("ServerScriptService").Modules.MapTest.BGMEvent:Fire(curPlaying[i],
Map.Settings:FindFirstChild("BGM") and Map.Settings.BGM.Value or
Map.Settings:GetAttribute("BGM"))
end
end)
UpdateGameState:FireClient(curPlaying[i], "ingame")
spawn(function()
if curPlaying[i].Character:FindFirstChild("PlrInfo")
then
curPlaying[i].Character.PlrInfo.Update.ShowInfo:Fire(curPlaying[i],nil,true)
end
curPlaying[i].Character.HumanoidRootPart.CFrame =
CFrame.new(math.random(xmin,xmax), Map.Spawn.Position.Y + (Map.Spawn.Size.Y/2) + 3,
math.random(zmin,zmax)) * CFrame.Angles(0,math.rad(Map.Spawn.Rotation.Y),0)
--wait(1)
--if table.find(Loaded,curPlaying[i]) then
--
curPlaying[i].Character.HumanoidRootPart.Anchored = false
--end
end)
end
--task.wait(1) -- delay for good performance
playing = true
if lockedcount == false then
lockcounted = false
else
lockedcount = false
end
--
workspace.Lobby.GameInfo.SurfaceGui.Frame.TimeLeft.Percentage:TweenSize(UDim2.new(1
, 0, 1, 0), nil, "Linear", 0, true)
workspace.Lobby.GameInfo.SurfaceGui.Frame.Players.Text =
tostring(#curPlaying).."/"..tostring(#curPlaying).." Players"
col = difColors[Map.Settings:FindFirstChild("Difficulty") and
Map.Settings.Difficulty.Value or Map.Settings:GetAttribute("Difficulty")]
diftext = tabDif[Map.Settings:FindFirstChild("Difficulty") and
Map.Settings.Difficulty.Value or Map.Settings:GetAttribute("Difficulty")]
if col == nil then
col = Color3.new(0, 0, 0)
end
if diftext == nil then
diftext = "Unknown"
end
workspace.Lobby.GameInfo.SurfaceGui.Frame.Difficulty.Difficulty.Text =
diftext .. ": " .. (Map.Settings:FindFirstChild("Difficulty") and
Map.Settings.Difficulty.Value or Map.Settings:GetAttribute("Difficulty")) --note
put "Intensity" later
workspace.Lobby.GameInfo.SurfaceGui.Frame.Difficulty.BackgroundColor3 = col
--
workspace.Lobby.GameInfo.SurfaceGui.Frame.Difficulty.LockedUI.Arrow.ImageColor3 =
col
workspace.Lobby.GameInfo.SurfaceGui.Frame.MapName.Text =
(Map.Settings:FindFirstChild("MapName") and Map.Settings.MapName.Value or
Map.Settings:GetAttribute("MapName"))
pcall(function()workspace.Lobby.GameInfo.SurfaceGui.Frame.Creator.Text =
"Creators: " .. (Map.Settings:FindFirstChild("Creator") and
Map.Settings.Creator.Value or Map.Settings:GetAttribute("Creator") or '') end)
workspace.Lobby.GameInfo.SurfaceGui.Frame.Imgs.MapImg.Image =
"rbxassetid://"..tostring(Map.Settings:FindFirstChild("MapImage") and
Map.Settings.MapImage.Value or Map.Settings:GetAttribute("MapImage"))
workspace.Lobby.MapBG.SurfaceGui.Frame.MapImg.Image =
"rbxassetid://"..tostring(Map.Settings:FindFirstChild("MapImage") and
Map.Settings.MapImage.Value or Map.Settings:GetAttribute("MapImage"))
--task.wait(1)--0
Map.Name = "Map"
local msg = (Map.Settings:FindFirstChild("MapName") and
Map.Settings.MapName.Value or Map.Settings:GetAttribute("MapName")).."
["..diftext.."] by "..(Map.Settings:FindFirstChild("Creator") and
Map.Settings.Creator.Value or Map.Settings:GetAttribute("Creator") or '')
local maxtime = 120
if Map.Settings:FindFirstChild("MaxTime") ~= nil then
if Map.Settings.MaxTime.Value >= 10 and
Map.Settings.MaxTime.Value <= 300 then
maxtime = Map.Settings.MaxTime.Value
end
elseif Map.Settings:GetAttribute("MaxTime") ~= nil then
if Map.Settings:GetAttribute("MaxTime") >= 10 and
Map.Settings:GetAttribute("MaxTime") <= 300 then
maxtime = Map.Settings:GetAttribute("MaxTime")
end
end
Ingamestats.timerStart = tick()
Ingamestats.timerDuration = maxtime
Ingamestats.boostingEnabled = true
UpdIngameStatsFunc()
task.wait(1) --delay to let everything load afterwards
local eventinfo = MapInitModule.intMap(Map,event)
pcall(function()
game.Workspace.Multiplayer.PlayingBGM.Value =
Map.Settings:FindFirstChild("BGM") and Map.Settings.BGM.Value or
Map.Settings:GetAttribute("BGM")
end)
loadedmapvals = false
if eventinfo.eventStartAlert ~= "" then
for i = 1, #curPlaying do
--Alert:FireClient(curPlaying[i], msg, col, 3, false)
if eventinfo.eventType == "rescue" then
Sound:FireClient(curPlaying[i],15020055493,0.5,1.05)
Alert:FireClient(curPlaying[i],eventinfo.eventStartAlert,Color3.fromRGB(241,
219, 128),nil,"event")
elseif eventinfo.eventType == "thickfog" then
Sound:FireClient(curPlaying[i],15020045848,0.5,1)
Alert:FireClient(curPlaying[i],eventinfo.eventStartAlert,Color3.fromRGB(241,
77, 189),nil,"event")
elseif eventinfo.eventType == "explodingbuttons" then
Sound:FireClient(curPlaying[i],15020052113,0.5,1)
Alert:FireClient(curPlaying[i],eventinfo.eventStartAlert,Color3.fromRGB(170,
85, 0),nil,"event")
elseif eventinfo.eventType == "groupbuttons" then
Sound:FireClient(curPlaying[i],15020053230,0.5,1)
Alert:FireClient(curPlaying[i],eventinfo.eventStartAlert,Color3.fromRGB(0, 0,
255),nil,"event")
elseif eventinfo.eventType == "mirror" then
Sound:FireClient(curPlaying[i],15020048956,0.5,1.05)
Alert:FireClient(curPlaying[i],eventinfo.eventStartAlert,Color3.fromRGB(85,
170, 127),nil,"event")
elseif eventinfo.eventType == "lostpage" then
Sound:FireClient(curPlaying[i],15020054136,0.5,1)
Alert:FireClient(curPlaying[i],eventinfo.eventStartAlert,Color3.fromRGB(0,
255, 0),nil,"event")
end
end--v168, "eventmsg", Color3.fromRGB(241, 219, 128), nil,
"event"
else
Alert:FireAllClients(nil,nil,nil,"event")
end
for i = 1, #curPlaying do
if table.find(Loaded,curPlaying[i]) then
curPlaying[i].Character.HumanoidRootPart.Anchored =
false
end
end
MapInitModule.activateButton(1)
MapInitModule.startMapEvents(hasTimelines or
Map:FindFirstChild("EventString") or Map:FindFirstChild("EventScript"))
if Map:FindFirstChild("LocalEventScript") then
for i = 1, #curPlaying do
local a = Map.LocalEventScript:Clone()
a.Parent = curPlaying[i].Character
a.Disabled = false
end
end
if Map:FindFirstChild("EventLocal") then
for i = 1, #curPlaying do
local a = Map.EventLocal:Clone()
a.Parent = curPlaying[i].Character
a.Disabled = false
end
end
bestTime = maxtime
game.Workspace.Lobby.GameInfo.SurfaceGui.Frame.Difficulty.Difficulty.Text =
(difInfos[ActualDif(Intensity)].Name .. ": " .. Intensity)
game.Workspace.Lobby.GameInfo.SurfaceGui.Frame.Difficulty.BackgroundColor3 =
difInfos[ActualDif(Intensity)].Color
local calcd = getIntensityChange(#Survivors / PAS,
PlayedDif, BoostedIntensity)
difChange = backInts .. (calcd > 0 and " + " or " - ") ..
string.format('%.2f', (Intensity - backInts - (boosted and boosts or 0))) ..
(boosted and ' (+ ' .. boosts .. ' Boost)' or '') .. " = " .. Intensity
Alert:FireClient(Survivors[i], --"\
226\154\160\239\184\143"..
tostring(#Survivors).."/"..tostring(PAS).." Escaped:
"..difChange.." Int." --\226\154\160\239\184\143"
,
game.Workspace.Lobby.GameInfo.SurfaceGui.Frame.Difficulty.BackgroundColor3, 5--,
"event"
, false)--waitingtime, true) -- surviving map is not 'Map
Event', "event" is used for only 'Map Event'.
if Survivors[i].Character == nil then
if
Survivors[i].Character:FindFirstChild("EventLocal") then
Survivors[i].Character.EventLocal:Destroy()
elseif
Survivors[i].Character:FindFirstChild("LocalEventScript") then
Survivors[i].Character.LocalEventScript:Destroy()
end
end
end
wait(0)
if #Survivors > (PAS / 2) then
if CurDif >= 4 then
end
if CurDif < 4 then
CurDif = CurDif + 1
end
else
Winsinrow = 0
if CurDif > 0 then
CurDif = CurDif - 1
end
end
if SpcRnd == true then
CurDif = 3
end
if lockedcount == false then
lockcounted = false
else
lockedcount = false
end
--
workspace.Lobby.GameInfo.SurfaceGui.Frame.TimeLeft.Percentage:TweenSize(UDim2.new(0
, 0, 1, 0), nil, "Linear", 0, true)
workspace.Lobby.GameInfo.SurfaceGui.Frame.MapName.Text =
("Ready!")
workspace.Lobby.GameInfo.SurfaceGui.Frame.Players.Text =
("Waiting for Players")
Playing = false
SpcRnd = false
wait(0)
for i = 1, #Survivors do
if Survivors[i] and Survivors[i].Character then
local suc,err = pcall(function()
spawn(function()
local survivor = Survivors[i]
local waitingstart = tick()
while tick() - waitingstart < 8 do
wait()
if survivor == nil then
break
end
end
pcall(function()
Survivors[i].Character.HumanoidRootPart.Anchored = true
end)
end)
table.insert(Waiting, Survivors[i])
UpdPlayerData:FireClient(Survivors[i],
MainData[Survivors[i].Name].plrData)
end)
if not suc then
pcall(function()
--print("Error Line 2773~2780: " .. err)
Alert:FireClient(Survivors[i],"An error
occured on teleporting.",Color3.fromRGB(255,0,0))
end)
end
end
end
else
playeda = false
Ingamestats.gameStatus = "intermission"
timerstart = 0
Ingamestats.timerStart = 0
Ingamestats.timerDuration = -1
Ingamestats.boostingEnabled = true
UpdIngameStatsFunc()
--
workspace.Lobby.GameInfo.SurfaceGui.Frame.TimeLeft.Percentage:TweenSize(UDim2.new(1
, 0, 1, 0), nil, "Linear", 0, true)
wait(0)
end
end
end