Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --By the_king_here/lenovo768
- --[[
- Squid Game Round Manager System
- Handles all round-based logic including Red Light/Green Light, Rope Map with Modes (Easy/Hard), teleportation, gamepasses, and developer products.
- Built using Knit framework.
- ]]
- --SERVICES
- local Knit = require(game:GetService("ReplicatedStorage").Packages.Knit)
- local Manager = require(game.ServerScriptService.PlayerData.Manager)
- local TweenService = game:GetService("TweenService")
- local RunService = game:GetService("RunService")
- local MPS = game:GetService("MarketplaceService")
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local InsertService = game:GetService("InsertService")
- local SoundService = game:GetService("SoundService")
- --Remote Events/Signals to communicate with clients/server
- local MapHandlerService = Knit.CreateService{
- Name = "MapHandlerService",
- Client = {
- Timer = Knit.CreateSignal(),
- Message = Knit.CreateSignal(),
- AnimateRopes = Knit.CreateSignal(),
- BlockGoingBack = Knit.CreateSignal(),
- RoundEnd = Knit.CreateSignal(),
- NameTag = Knit.CreateSignal(),
- UpdateRewardStatus = Knit.CreateSignal(),
- MusicEvent = Knit.CreateSignal(),
- SquidMusic = Knit.CreateSignal(),
- }
- }
- --VARIABLES
- local Maps = workspace:FindFirstChild("Maps")
- local notificationRemote = ReplicatedStorage.Events:WaitForChild("NotificationRemote")
- local Light1 = workspace.Maps.DollMap.Light1
- local Light2 = workspace.Maps.DollMap.Light2
- local tweenInfo = TweenInfo.new(0.5, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, 0)
- local tweenInfoForMusic = TweenInfo.new(1.5, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, 0)
- local RedlightSound = Maps.HadRopeMap.Doll.HumanoidRootPart:FindFirstChild("RedLight")
- local GreenLightSound = Maps.HadRopeMap.Doll.HumanoidRootPart:FindFirstChild("GreenLight")
- local SquidGameMusic = SoundService:FindFirstChild("Music")
- local BackgroundMusic = SoundService:FindFirstChild("LobbyMusic")
- local playerInDollGame = {}
- local PlayerInEasyRopeGame = {}
- local PlayerInHardRopeGame = {}
- local teleportedPlayers = {}
- local HardTeleportedPlayers = {}
- local Products = {
- EliminatePlayers = 3312415657,
- SpeedTroll = 3312416017,
- KillRandomPersonTroll = 3312444642,
- TakeCoinsTroll = 3312417586,
- }
- local PushProducts = {
- Push1 = 3313283431,
- Push2 = 3313283430,
- Push5 = 3313283433,
- Push7 = 3313283424,
- Push10 = 3313286623,
- }
- local ShouldAnimateDoll = false
- local ShouldAnimateRopeLight = false
- local IsRopeGreenLight
- local EasyRopeAnimationConnection
- local HardRopeAnimationConnection
- local initialCFrameEasyRope
- local initialCFrameHardRope
- local collider = workspace.Maps.EasyRopemap:WaitForChild("HitRope").PrimaryPart
- local collider2 = workspace.Maps.HadRopeMap:WaitForChild("HitRope").PrimaryPart
- --Function to handle all logics which are neccessory to execute when rope game ends
- function MapHandlerService:EndRopeGame(Mode)
- if Mode == "Easy" then
- collider.CFrame = initialCFrameEasyRope
- else
- ShouldAnimateRopeLight = false
- collider2.CFrame = initialCFrameHardRope
- end
- SquidGameMusic:Stop()
- if Mode == "Easy" then
- for i, player in pairs(game.Players:GetPlayers()) do
- if player:FindFirstChild("PlayerSelectedMode").Value ~= "Easy" then continue end
- self.Client.RoundEnd:Fire(player, Mode)
- end
- else
- for i, player in pairs(game.Players:GetPlayers()) do
- if player:FindFirstChild("PlayerSelectedMode").Value ~= "Hard" then continue end
- self.Client.RoundEnd:Fire(player, Mode)
- end
- end
- if Mode == "Easy" then
- local success, errormsg = pcall(function()
- for i, player in pairs(game.Players:GetPlayers()) do
- if player:FindFirstChild("PlayerSelectedMode").Value ~= "Easy" then continue end
- local char = player.Character
- if char then
- local Humanoid = char:FindFirstChildOfClass("Humanoid")
- if Humanoid then
- if Humanoid.Health <= 0 then
- continue
- end
- end
- self.Client.SquidMusic:Fire(player, "Stop")
- if (char.PrimaryPart.Position - workspace.Maps.EasyLobby.TeleportPoints.Center.Position).Magnitude > 130 then
- char:PivotTo(workspace.Maps.EasyLobby.TeleportPoints:GetChildren()[math.random(1, #workspace.Maps.EasyLobby.TeleportPoints:GetChildren())].CFrame)
- end
- end
- end
- end)
- EasyRopeAnimationConnection:Disconnect()
- table.clear(teleportedPlayers)
- else
- local success, errormsg = pcall(function()
- for i, player in pairs(game.Players:GetPlayers()) do
- if player:FindFirstChild("PlayerSelectedMode").Value ~= "Hard" then continue end
- local char = player.Character
- if char then
- local Humanoid = char:FindFirstChildOfClass("Humanoid")
- if Humanoid then
- if Humanoid.Health <= 0 then
- continue
- end
- end
- print("Runned")
- self.Client.SquidMusic:Fire(player, "Stop")
- if (char.PrimaryPart.Position - workspace.Maps.HardLobby.TeleportPoints.Center.Position).Magnitude > 130 then
- char:PivotTo(workspace.Maps.HardLobby.TeleportPoints:GetChildren()[math.random(1, #workspace.Maps.HardLobby.TeleportPoints:GetChildren())].CFrame)
- end
- end
- end
- end)
- HardRopeAnimationConnection:Disconnect()
- table.clear(HardTeleportedPlayers)
- end
- end
- --Function to count players that are playing hard mode
- function MapHandlerService:PlayersInHardMode()
- local Count = 0
- for i, player in pairs(game.Players:GetPlayers()) do
- if player:WaitForChild("PlayerSelectedMode").Value == "Hard" then
- Count += 1
- end
- end
- return Count
- end
- --Function to count players that are playing easy mode
- function MapHandlerService:PlayersInEasyMode()
- local Count = 0
- for i, player in pairs(game.Players:GetPlayers()) do
- if player:WaitForChild("PlayerSelectedMode").Value == "Easy" then
- Count += 1
- end
- end
- return Count
- end
- --Function to teleport player to the easy/hard rope map
- function MapHandlerService:TeleportPlayerToTheMap(MapName)
- local Map = Maps:FindFirstChild(MapName)
- if not Map then warn("No map found with the name: "..MapName) return end
- for i, player in pairs(game.Players:GetPlayers()) do
- if Map.Name == "EasyRopemap" and player:FindFirstChild("PlayerSelectedMode").Value ~= "Easy" then continue end
- if Map.Name == "HadRopeMap" and player:FindFirstChild("PlayerSelectedMode").Value ~= "Hard" then continue end
- local char = player.Character
- if not char then return end
- if Map.Name == "EasyRopemap" or Map.Name == "HadRopeMap" then
- if Map.Name == "EasyRopemap" then
- table.insert(PlayerInEasyRopeGame, player)
- local RandomTeleportPoint:BasePart = Map.StartPoints:GetChildren()[math.random(1, #Maps.EasyRopemap.StartPoints:GetChildren())]
- char:PivotTo(RandomTeleportPoint.CFrame)
- else
- table.insert(PlayerInHardRopeGame, player)
- local RandomTeleportPoint:BasePart = Map.StartPoints:GetChildren()[math.random(1, #Maps.HadRopeMap.StartPoints:GetChildren())]
- char:PivotTo(RandomTeleportPoint.CFrame)
- end
- local Humanoid = char:FindFirstChildOfClass("Humanoid")
- if Humanoid then
- Humanoid.Died:Connect(function()
- if Map.Name == "EasyRopemap" then
- if table.find(PlayerInEasyRopeGame, player) then
- table.remove(PlayerInEasyRopeGame, table.find(PlayerInEasyRopeGame, player))
- end
- else
- if table.find(PlayerInHardRopeGame, player) then
- table.remove(PlayerInHardRopeGame, table.find(PlayerInHardRopeGame, player))
- end
- end
- end)
- end
- else
- table.insert(playerInDollGame, player)
- end
- end
- end
- --function to teleport players to the train track, from where the round will start
- function MapHandlerService:TeleportPlayerToInGame(Mode)
- local Map
- if Mode == "Easy" then
- Map = Maps:FindFirstChild("EasyRopemap")
- else
- Map = Maps:FindFirstChild("HadRopeMap")
- end
- if not Map then return end
- if Mode == "Easy" then
- local teleportPoints = Map.InGameTeleport:GetChildren()
- if #teleportPoints == 0 then
- warn("No teleport points found in InGameTeleport1")
- return
- end
- local unteleportedPlayers = {}
- for _, player in ipairs(game.Players:GetPlayers()) do
- if player:FindFirstChild("PlayerSelectedMode").Value ~= "Easy" then continue end
- if not table.find(teleportedPlayers, player) then
- table.insert(unteleportedPlayers, player)
- end
- end
- if #unteleportedPlayers == 0 then
- warn("All players have already been teleported.")
- return
- end
- local function ShuffleArray(array)
- for i = #array, 2, -1 do
- local j = math.random(1, i)
- array[i], array[j] = array[j], array[i]
- end
- end
- ShuffleArray(unteleportedPlayers)
- for i = 1, self:PlayersInEasyMode() - #teleportedPlayers do
- local player = unteleportedPlayers[i]
- local char = player.Character
- local teleportPoint = teleportPoints[1]
- if player and char and teleportPoint then
- char:PivotTo(teleportPoint.CFrame)
- table.insert(playerInDollGame, player)
- table.insert(teleportedPlayers, player)
- end
- end
- else
- local teleportPoints = Map.InGameTeleport:GetChildren()
- if #teleportPoints == 0 then
- warn("No teleport points found in InGameTeleport1")
- return
- end
- local unteleportedPlayers = {}
- for _, player in ipairs(game.Players:GetPlayers()) do
- if player:FindFirstChild("PlayerSelectedMode").Value ~= "Hard" then continue end
- if not table.find(HardTeleportedPlayers, player) then
- table.insert(unteleportedPlayers, player)
- end
- end
- if #unteleportedPlayers == 0 then
- warn("All players have already been teleported.")
- return
- end
- local function ShuffleArray(array)
- for i = #array, 2, -1 do
- local j = math.random(1, i)
- array[i], array[j] = array[j], array[i]
- end
- end
- ShuffleArray(unteleportedPlayers)
- for i = 1, self:PlayersInHardMode() - #HardTeleportedPlayers do
- local player = unteleportedPlayers[i]
- local char = player.Character
- local teleportPoint = teleportPoints[1]
- if player and char and teleportPoint then
- char:PivotTo(teleportPoint.CFrame)
- table.insert(playerInDollGame, player)
- table.insert(HardTeleportedPlayers, player)
- end
- end
- end
- end
- --Controls RedLight / GreenLight logic including player speed checks and win detection
- function MapHandlerService:AnimateDoll()
- local Doll = Maps.DollMap:FindFirstChild("Doll")
- local RedLightSound = Doll.HumanoidRootPart.RedLight
- local GreenLightSound = Doll.HumanoidRootPart.GreenLight
- local IsGreenLight = true
- GreenLightSound:Play()
- TweenService:Create(Doll.Model.PrimaryPart, tweenInfo, {CFrame = Doll.Model.PrimaryPart.CFrame * CFrame.Angles(0, math.rad(180), 0)}):Play()
- task.spawn(function()
- while wait(0.1) do
- if IsGreenLight then continue end
- if not ShouldAnimateDoll then break end
- for i, player in pairs(playerInDollGame) do
- local char = player.Character
- if not char then return end
- if char.PrimaryPart.AssemblyLinearVelocity.Magnitude > 4 then
- task.delay(0.4, function()
- if char.PrimaryPart.AssemblyLinearVelocity.Magnitude > 4 then
- local Humanoid = char:FindFirstChildOfClass("Humanoid")
- Humanoid:TakeDamage(Humanoid.MaxHealth)
- end
- end)
- end
- end
- end
- end)
- local FinishPart = Maps.DollMap:FindFirstChild("FinishPart")
- FinishPart.Touched:Connect(function(hit)
- local player = game.Players:GetPlayerFromCharacter(hit.Parent)
- if not player then player = game.Players:GetPlayerFromCharacter(hit.Parent.Parent) end
- if not player then return end
- if not table.find(playerInDollGame, player) then return end
- self.Client.Message:Fire(player, "You Won!")
- player.leaderstats.Wins.Value += 1
- if table.find(playerInDollGame, player) then
- table.remove(playerInDollGame, table.find(playerInDollGame, player))
- end
- if #playerInDollGame == 0 then
- ShouldAnimateDoll = false
- wait(1)
- local rootLookVector = Doll.HumanoidRootPart.CFrame.LookVector
- local dollLookVector = Doll.Model.PrimaryPart.CFrame.LookVector
- local dot = rootLookVector:Dot(dollLookVector)
- if dot < 0 then
- local tweenInfo = TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
- local targetCFrame = Doll.Model.PrimaryPart.CFrame * CFrame.Angles(0, math.rad(180), 0)
- TweenService:Create(Doll.Model.PrimaryPart, tweenInfo, {CFrame = targetCFrame}):Play()
- end
- end
- end)
- task.spawn(function()
- while ShouldAnimateDoll do
- if not IsGreenLight then
- wait(math.random(2, 5))
- if not ShouldAnimateDoll then break end
- if Doll.Model.PrimaryPart then
- GreenLightSound:Play()
- TweenService:Create(Doll.Model.PrimaryPart, tweenInfo, {CFrame = Doll.Model.PrimaryPart.CFrame * CFrame.Angles(0, math.rad(180), 0)}):Play()
- Light1.light.Color = Color3.fromRGB(0, 255, 0)
- Light2.light.Color = Color3.fromRGB(0, 255, 0)
- end
- IsGreenLight = true
- else
- wait(math.random(2,5))
- if not ShouldAnimateDoll then break end
- if Doll.Model.PrimaryPart then
- RedLightSound:Play()
- TweenService:Create(Doll.Model.PrimaryPart, tweenInfo, {CFrame = Doll.Model.PrimaryPart.CFrame * CFrame.Angles(0, math.rad(-180), 0)}):Play()
- Light1.light.Color = Color3.fromRGB(196, 40, 28)
- Light2.light.Color = Color3.fromRGB(196, 40, 28)
- end
- IsGreenLight = false
- end
- end
- end)
- end
- --shape the simple seconds into Minutes:Seconds Formate like 00:00
- function MapHandlerService:FormatTime(seconds)
- seconds = math.max(0, math.floor(seconds))
- local minutes = math.floor(seconds / 60)
- local secs = seconds % 60
- return string.format("%02d:%02d", minutes, secs)
- end
- --Handle all of the developer products after it's been purchased
- function MapHandlerService:DeveloperProductsHandler()
- MPS.PromptProductPurchaseFinished:Connect(function(userId, ProductId, IsPurchased)
- if not IsPurchased then return end
- print("Runned", IsPurchased, ProductId)
- local Buyer = game.Players:GetPlayerByUserId(userId)
- if ProductId == Products.EliminatePlayers then
- for i, player in pairs(game.Players:GetPlayers()) do
- if player ~= Buyer then
- local char = player.Character
- local Humanoid = char:FindFirstChildOfClass("Humanoid")
- if not Humanoid then return end
- Humanoid:TakeDamage(Humanoid.MaxHealth)
- notificationRemote:FireClient(player, "You Got Trolled!", {Bad = false})
- end
- end
- elseif ProductId == Products.KillRandomPersonTroll then
- local players = game.Players:GetPlayers()
- if #players > 1 then
- local randomPlayer = players[math.random(1, #players)]
- repeat
- wait()
- randomPlayer = players[math.random(1, #players)]
- until randomPlayer ~= Buyer
- local char = randomPlayer.Character
- local Humanoid = char:FindFirstChildOfClass("Humanoid")
- if not Humanoid then return end
- Humanoid:TakeDamage(Humanoid.MaxHealth)
- end
- elseif ProductId == Products.SpeedTroll then
- for i, player in pairs(game.Players:GetPlayers()) do
- if player ~= Buyer then
- local char = player.Character
- local Humanoid = char:FindFirstChildOfClass("Humanoid")
- if not Humanoid then return end
- Humanoid.WalkSpeed = 100
- delay(30, function()
- if player and Humanoid then
- Humanoid.WalkSpeed = 16
- end
- end)
- notificationRemote:FireClient(player, "You Got Trolled!", {Bad = false})
- end
- end
- elseif ProductId == Products.TakeCoinsTroll then
- local TookCoins = 0
- for i, player in pairs(game.Players:GetPlayers()) do
- if player ~= Buyer then
- local leaderstats = player:FindFirstChild("leaderstats")
- local Coins = leaderstats:FindFirstChild("Coins")
- if not Coins then return end
- if Coins.Value >= 10 then
- Coins.Value -= 10
- TookCoins += 10
- else
- TookCoins += Coins.Value
- Coins.Value = 0
- end
- notificationRemote:FireClient(player, "Someone Took Your Coins, Happy Troll!", {Bad = false})
- end
- local BuyerLeaderstats = Buyer:FindFirstChild("leaderstats")
- local Coins = Buyer:FindFirstChild("Coins")
- if Coins then
- Coins.Value += TookCoins
- end
- end
- elseif ProductId == PushProducts.Push1 then
- local PlayerPushes = Buyer:FindFirstChild("Pushes")
- if PlayerPushes then
- PlayerPushes.Value += 1
- else
- print("Player Pushes not found")
- end
- elseif ProductId == PushProducts.Push2 then
- local PlayerPushes = Buyer:FindFirstChild("Pushes")
- if PlayerPushes then
- PlayerPushes.Value += 2
- end
- elseif ProductId == PushProducts.Push5 then
- local PlayerPushes = Buyer:FindFirstChild("Pushes")
- if PlayerPushes then
- PlayerPushes.Value += 5
- end
- elseif ProductId == PushProducts.Push7 then
- local PlayerPushes = Buyer:FindFirstChild("Pushes")
- if PlayerPushes then
- PlayerPushes.Value += 7
- end
- elseif ProductId == PushProducts.Push10 then
- local PlayerPushes = Buyer:FindFirstChild("Pushes")
- if PlayerPushes then
- PlayerPushes.Value += 10
- end
- elseif ProductId == 3314212399 then
- local Coins = Buyer:WaitForChild("leaderstats"):WaitForChild("Coins")
- if Coins then
- Coins.Value += 50
- end
- elseif ProductId == 3314212620 then
- local Coins = Buyer:WaitForChild("leaderstats"):WaitForChild("Coins")
- if Coins then
- Coins.Value += 100
- end
- elseif ProductId == 3314213085 then
- local Coins = Buyer:WaitForChild("leaderstats"):WaitForChild("Coins")
- if Coins then
- Coins.Value += 300
- end
- elseif ProductId == 3314213295 then
- local Coins = Buyer:WaitForChild("leaderstats"):WaitForChild("Coins")
- if Coins then
- Coins.Value += 500
- end
- elseif ProductId == 3314214142 then
- local Coins = Buyer:WaitForChild("leaderstats"):WaitForChild("Coins")
- if Coins then
- Coins.Value += 1000
- end
- elseif ProductId == 3314996213 then
- local ExtraLifes = Buyer:FindFirstChild("ExtraLifes")
- if ExtraLifes then
- ExtraLifes.Value += 1
- end
- elseif ProductId == 3314996574 then
- local LessGravity = Buyer:FindFirstChild("LessGravity")
- if LessGravity then
- LessGravity.Value += 1
- end
- elseif ProductId == 3314996930 then
- self.Client.NameTag:Fire(Buyer)
- end
- end)
- end
- --function to apply rainbow type animation to specific label/name tag
- function MapHandlerService:applyRainbowTween(label)
- local rainbow = label
- local grad = rainbow.UIGradient
- local counter = 0
- local w = math.pi / 12
- local CS = {}
- local num = 15
- local frames = 0
- RunService.Heartbeat:Connect(function()
- if math.fmod(frames, 2) == 0 then
- for i = 0, num do
- local c = Color3.fromRGB(127 * math.sin(w*i + counter) + 128, 127 * math.sin(w*i + 2 * math.pi/3 + counter) + 128, 127*math.sin(w*i + 4*math.pi/3 + counter) + 128)
- table.insert(CS, i+1, ColorSequenceKeypoint.new(i/num, c))
- end
- grad.Color = ColorSequence.new(CS)
- CS = {}
- counter = counter - math.pi/40
- if (counter >= math.pi * 2) then
- counter = 0
- end
- end
- if frames >= 1000 then
- frames = 0
- end
- frames = frames + 1
- end)
- end
- --function to handle gamepasses after been purchased
- function MapHandlerService:HandleGamepasses()
- MPS.PromptGamePassPurchaseFinished:Connect(function(UserId, ganmepassId, IsPurchased)
- if not IsPurchased then return end
- local player = game.Players:GetPlayerByUserId(UserId)
- if ganmepassId == 1274510513 then
- local NameTag = ReplicatedStorage.Assets:FindFirstChild("nametagui")
- if NameTag then
- if player.Character:FindFirstChild("Head"):FindFirstChild(NameTag.Name) then
- player.Character:FindFirstChild("Head"):FindFirstChild(NameTag.Name):Destroy()
- end
- local CloneNameTag = NameTag:Clone()
- CloneNameTag.Parent = player.Character:FindFirstChild("Head")
- CloneNameTag.ntframe.username.Text = player.Name
- self:applyRainbowTween(CloneNameTag.ntframe.username)
- end
- end
- end)
- end
- --This function checks whether a player is walking, and if so, eliminates them, It ignores players who are jumping by only getting horizontal velocity components and excluding the vertical axis.
- function MapHandlerService:KillIfWalking(player:Player)
- local character = player.Character
- if not character or not character:FindFirstChild("HumanoidRootPart") or not character:FindFirstChild("Humanoid") or character:FindFirstChildOfClass("Humanoid").Health <= 0 then
- return
- end
- if IsRopeGreenLight then return end
- local hrp = character.HumanoidRootPart
- local velocity = hrp.AssemblyLinearVelocity
- local horizontalSpeed = Vector3.new(velocity.X, 0, velocity.Z).Magnitude
- local verticalSpeed = velocity.Y
- local HORIZONTAL_SPEED_THRESHOLD = 3
- local VERTICAL_JUMP_LIMIT = 10
- if horizontalSpeed > HORIZONTAL_SPEED_THRESHOLD then
- task.delay(0.5, function()
- velocity = hrp.AssemblyLinearVelocity
- horizontalSpeed = Vector3.new(velocity.X, 0, velocity.Z).Magnitude
- verticalSpeed = velocity.Y
- if horizontalSpeed > HORIZONTAL_SPEED_THRESHOLD then
- character.Humanoid.Health = 0
- end
- end)
- end
- end
- --it animates red/green lights for rope map
- function MapHandlerService:AnimateLights()
- local RedLight = workspace.Maps.HadRopeMap.Light.RedLight.Part
- local GreenLight = workspace.Maps.HadRopeMap.Light.GreenLight.Part
- ShouldAnimateRopeLight = true
- task.spawn(function()
- RedLight.Material = Enum.Material.SmoothPlastic
- RedLight.Color = Color3.new(0, 0, 0)
- GreenLight.Material = Enum.Material.Neon
- GreenLight.Color = Color3.new(0, 1, 0)
- IsRopeGreenLight = true
- GreenLightSound:Play()
- local Success, Pcall = pcall(function()
- for i, player in pairs(PlayerInHardRopeGame) do
- local playerGui = player.PlayerGui
- if playerGui then
- local GreenFrame = playerGui.LightUI:FindFirstChild("GreenFrame")
- local RedFrame = playerGui.LightUI:FindFirstChild("RedFrame")
- if GreenFrame then
- GreenFrame.Visible = true
- RedFrame.Visible = false
- task.delay(1.5, function()
- GreenFrame.Visible = false
- RedFrame.Visible = false
- end)
- end
- end
- end
- end)
- wait(2)
- local Success, Pcall = pcall(function()
- while ShouldAnimateRopeLight do
- warn("loop running")
- wait(math.random(4, 7))
- if not IsRopeGreenLight then
- if not ShouldAnimateRopeLight then
- break
- end
- RedLight.Material = Enum.Material.SmoothPlastic
- RedLight.Color = Color3.new(0, 0, 0)
- GreenLight.Material = Enum.Material.Neon
- GreenLight.Color = Color3.new(0, 1, 0)
- GreenLightSound:Play()
- IsRopeGreenLight = true
- for i, player in pairs(PlayerInHardRopeGame) do
- local playerGui = player.PlayerGui
- if playerGui then
- local GreenFrame = playerGui.LightUI:FindFirstChild("GreenFrame")
- local RedFrame = playerGui.LightUI:FindFirstChild("RedFrame")
- if GreenFrame then
- GreenFrame.Visible = true
- RedFrame.Visible = false
- task.delay(1.5, function()
- GreenFrame.Visible = false
- RedFrame.Visible = false
- end)
- end
- end
- end
- else
- if not ShouldAnimateRopeLight then
- break
- end
- RedLight.Material = Enum.Material.Neon
- RedLight.Color = Color3.new(1, 0, 0)
- GreenLight.Material = Enum.Material.SmoothPlastic
- GreenLight.Color = Color3.new(0, 0, 0)
- RedlightSound:Play()
- IsRopeGreenLight = false
- for i, player in pairs(PlayerInHardRopeGame) do
- local playerGui = player.PlayerGui
- if playerGui then
- local GreenFrame = playerGui.LightUI:FindFirstChild("GreenFrame")
- local RedFrame = playerGui.LightUI:FindFirstChild("RedFrame")
- if GreenFrame then
- GreenFrame.Visible = false
- RedFrame.Visible = true
- task.delay(1.5, function()
- GreenFrame.Visible = false
- RedFrame.Visible = false
- end)
- end
- end
- end
- end
- end
- RedLight.Material = Enum.Material.SmoothPlastic
- RedLight.Color = Color3.new(0, 0, 0)
- GreenLight.Material = Enum.Material.SmoothPlastic
- GreenLight.Color = Color3.new(0, 0, 0)
- end)
- end)
- end
- --This function gives player extra life if player owns some extra lifes, if player accidently falls down it automatically teleport player back to the nearest checkpoints on the train track
- function MapHandlerService:TeleportToNearestCheckpoint(player, checkpoints)
- if not player or not player.Character or not player.Character:FindFirstChild("HumanoidRootPart") then
- warn("Invalid player or character not fully loaded.")
- return
- end
- local rootPart = player.Character.HumanoidRootPart
- local closestCheckpoint = nil
- local shortestDistanceSq = math.huge
- for _, checkpoint in ipairs(checkpoints) do
- local checkpointPosition
- if checkpoint:IsA("Model") then
- if checkpoint.PrimaryPart then
- checkpointPosition = checkpoint.PrimaryPart.Position
- else
- warn("Checkpoint model has no PrimaryPart.")
- continue
- end
- elseif checkpoint:IsA("BasePart") then
- checkpointPosition = checkpoint.Position
- else
- warn("Checkpoint is not a valid BasePart or Model.")
- continue
- end
- local distanceSq = (rootPart.Position - checkpointPosition).Magnitude ^ 2
- if distanceSq < shortestDistanceSq then
- shortestDistanceSq = distanceSq
- closestCheckpoint = checkpoint
- end
- end
- if closestCheckpoint then
- local destination
- if closestCheckpoint:IsA("Model") and closestCheckpoint.PrimaryPart then
- destination = closestCheckpoint.PrimaryPart.Position
- elseif closestCheckpoint:IsA("BasePart") then
- destination = closestCheckpoint.Position
- end
- rootPart.CFrame = CFrame.new(destination)
- else
- warn("No valid checkpoints found.")
- end
- end
- --[[
- This function controls the main rope map round and handles the rope animation. It also uses a timing trick, it sends the animation command to clients a few seconds early along with the start time,
- Then when that time comes, all clients play the animation at the same moment, which helps avoid lag caused by ping
- ]]
- function MapHandlerService:RopeMap(Mode)
- if Mode == "Easy" then
- self:TeleportPlayerToTheMap("EasyRopemap")
- else
- self:TeleportPlayerToTheMap("HadRopeMap")
- end
- wait(8)
- self:TeleportPlayerToInGame(Mode)
- local delayBeforeStart = 3
- local startTime = workspace:GetServerTimeNow() + delayBeforeStart
- if Mode == "Easy" then
- spawn(function()
- while wait(1) do
- if #PlayerInEasyRopeGame == 0 then
- wait(5)
- table.clear(PlayerInEasyRopeGame)
- self:EndRopeGame(Mode)
- break
- end
- end
- end)
- else
- spawn(function()
- while wait(1) do
- if #PlayerInHardRopeGame == 0 then
- wait(5)
- table.clear(PlayerInHardRopeGame)
- self:EndRopeGame(Mode)
- break
- end
- end
- end)
- end
- if Mode == "Easy" then
- for i, player in pairs(PlayerInEasyRopeGame) do
- self.Client.SquidMusic:Fire(player, "Play")
- end
- else
- for i, player in pairs(PlayerInHardRopeGame) do
- self.Client.SquidMusic:Fire(player, "Play")
- end
- end
- spawn(function()
- local accelTime = 3
- local maxSpeed
- if Mode == "Easy" then
- initialCFrameEasyRope = collider.CFrame
- maxSpeed = math.rad(250)
- else
- initialCFrameHardRope = collider2.CFrame
- maxSpeed = math.rad(210)
- end
- local IsPrinted = false
- if Mode == "Easy" then
- EasyRopeAnimationConnection = RunService.Heartbeat:Connect(function()
- local now = workspace:GetServerTimeNow()
- if now < startTime then return end
- if not IsPrinted then
- IsPrinted = true
- warn("[Server] Started: ",now, startTime)
- end
- local elapsed = now - startTime
- local rotation
- if elapsed < accelTime then
- local progress = elapsed / accelTime
- rotation = 0.33 * maxSpeed * (progress ^ 3) * accelTime
- else
- local constantTime = elapsed - accelTime
- rotation = 0.33 * maxSpeed * accelTime + maxSpeed * constantTime
- end
- local newCFrame = initialCFrameEasyRope * CFrame.Angles(rotation, 0, 0)
- collider.CFrame = newCFrame
- end)
- else
- HardRopeAnimationConnection = RunService.Heartbeat:Connect(function()
- local now = workspace:GetServerTimeNow()
- if now < startTime then return end
- if not IsPrinted then
- IsPrinted = true
- warn("[Server] Started: ",now, startTime)
- end
- local elapsed = now - startTime
- local rotation
- if elapsed < accelTime then
- local progress = elapsed / accelTime
- rotation = 0.33 * maxSpeed * (progress ^ 3) * accelTime
- else
- local constantTime = elapsed - accelTime
- rotation = 0.33 * maxSpeed * accelTime + maxSpeed * constantTime
- end
- local newCFrame = initialCFrameHardRope * CFrame.Angles(rotation, 0, 0)
- collider2.CFrame = newCFrame
- for i, player in pairs(PlayerInHardRopeGame) do
- self:KillIfWalking(player)
- end
- end)
- end
- end)
- if Mode == "Easy" then
- for i, player in pairs(PlayerInEasyRopeGame) do
- self.Client.AnimateRopes:Fire(player, startTime, "Easy")
- end
- else
- for i, player in pairs(PlayerInHardRopeGame) do
- self.Client.AnimateRopes:Fire(player, startTime, "Hard")
- end
- end
- if Mode == "Hard" then
- self:AnimateLights()
- end
- spawn(function()
- if Mode == "Easy" then
- for i = 2 * 60, 0, -1 do
- wait(1)
- local FormatedTime = self:FormatTime(i)
- Maps.EasyRopemap.Timer.Part.SurfaceGui.TextLabel.Text = FormatedTime
- if #PlayerInEasyRopeGame == 0 or i == 0 then
- self:EndRopeGame(Mode)
- table.clear(PlayerInEasyRopeGame)
- break
- end
- end
- else
- for i = 2 * 60, 0, -1 do
- wait(1)
- local FormatedTime = self:FormatTime(i)
- Maps.HadRopeMap.Timer.Part.SurfaceGui.TextLabel.Text = FormatedTime
- if #PlayerInHardRopeGame == 0 or i == 0 then
- self:EndRopeGame(Mode)
- table.clear(PlayerInHardRopeGame)
- break
- end
- end
- end
- end)
- local Connection
- local Connection2
- local Connection3
- if Mode == "Easy" then
- Connection = workspace.Maps.EasyRopemap.FinishPoint.Touched:Connect(function(hit)
- local player = game.Players:GetPlayerFromCharacter(hit.Parent) or game.Players:GetPlayerFromCharacter(hit.Parent.Parent)
- if player then
- if not table.find(PlayerInEasyRopeGame, player) then return end
- local find = table.find(PlayerInEasyRopeGame, player)
- table.remove(PlayerInEasyRopeGame, find)
- player:WaitForChild("leaderstats"):WaitForChild("Wins").Value += 1
- player:WaitForChild("leaderstats"):WaitForChild("Coins").Value += 50
- if #PlayerInEasyRopeGame == 0 then
- self:EndRopeGame(Mode)
- table.clear(PlayerInEasyRopeGame)
- Connection:Disconnect()
- Connection2:Disconnect()
- Connection3:Disconnect()
- end
- end
- end)
- Connection2 = workspace.Maps.EasyRopemap.BlockGoingBack.Touched:Connect(function(hit)
- local player = game.Players:GetPlayerFromCharacter(hit.Parent) or game.Players:GetPlayerFromCharacter(hit.Parent.Parent)
- if player then
- self.Client.BlockGoingBack:Fire(player, Mode)
- end
- end)
- Connection3 = workspace.Maps.EasyRopemap.ExtraLifesChecker.Touched:Connect(function(hit)
- local player = game.Players:GetPlayerFromCharacter(hit.Parent) or game.Players:GetPlayerFromCharacter(hit.Parent.Parent)
- if player then
- local ExtraLifes = player:FindFirstChild("ExtraLifes")
- if ExtraLifes.Value == 0 then return end
- ExtraLifes.Value -= 1
- self:TeleportToNearestCheckpoint(player, Maps.EasyRopemap.Checkpoints:GetChildren())
- end
- end)
- else
- Connection = workspace.Maps.HadRopeMap.FinishPoint.Touched:Connect(function(hit)
- local player = game.Players:GetPlayerFromCharacter(hit.Parent) or game.Players:GetPlayerFromCharacter(hit.Parent.Parent)
- if player then
- if not table.find(PlayerInHardRopeGame, player) then return end
- local find = table.find(PlayerInHardRopeGame, player)
- table.remove(PlayerInHardRopeGame, find)
- player:WaitForChild("leaderstats"):WaitForChild("Wins").Value += 1
- player:WaitForChild("leaderstats"):WaitForChild("Coins").Value += 50
- if #PlayerInHardRopeGame == 0 then
- self:EndRopeGame(Mode)
- table.clear(PlayerInHardRopeGame)
- Connection:Disconnect()
- Connection2:Disconnect()
- Connection3:Disconnect()
- end
- end
- end)
- Connection2 = workspace.Maps.HadRopeMap.BlockGoingBack.Touched:Connect(function(hit)
- local player = game.Players:GetPlayerFromCharacter(hit.Parent) or game.Players:GetPlayerFromCharacter(hit.Parent.Parent)
- if player then
- self.Client.BlockGoingBack:Fire(player, Mode)
- end
- end)
- Connection3 = workspace.Maps.HadRopeMap.ExtraLifesChecker.Touched:Connect(function(hit)
- local player = game.Players:GetPlayerFromCharacter(hit.Parent) or game.Players:GetPlayerFromCharacter(hit.Parent.Parent)
- if player then
- local ExtraLifes = player:FindFirstChild("ExtraLifes")
- if ExtraLifes.Value == 0 then return end
- ExtraLifes.Value -= 1
- self:TeleportToNearestCheckpoint(player, Maps.HadRopeMap.Checkpoints:GetChildren())
- end
- end)
- end
- end
- --this function handles the main working of doll map round system
- function MapHandlerService:DollMap()
- self:TeleportPlayerToTheMap("DollMap")
- local Doll = Maps.DollMap:FindFirstChild("Doll")
- for i, player in pairs(playerInDollGame) do
- self.Client.Timer:Fire(player)
- local char = player.Character
- if not char then continue end
- local Humanoid = char:FindFirstChildOfClass("Humanoid")
- if Humanoid then
- Humanoid.Died:Connect(function()
- if table.find(playerInDollGame, player) then
- table.remove(playerInDollGame, table.find(playerInDollGame, player))
- end
- if #playerInDollGame == 0 then
- ShouldAnimateDoll = false
- wait(2)
- local rootLookVector = Doll.HumanoidRootPart.CFrame.LookVector
- local dollLookVector = Doll.Model.PrimaryPart.CFrame.LookVector
- local dot = rootLookVector:Dot(dollLookVector)
- if dot < 0 then
- local tweenInfo = TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
- local targetCFrame = Doll.Model.PrimaryPart.CFrame * CFrame.Angles(0, math.rad(180), 0)
- TweenService:Create(Doll.Model.PrimaryPart, tweenInfo, {CFrame = targetCFrame}):Play()
- end
- end
- end)
- end
- end
- wait(7)
- Maps.DollMap.InvisiblePart.CanCollide = false
- ShouldAnimateDoll = true
- self:AnimateDoll()
- spawn(function()
- for i = 3 * 60, 0, -1 do
- local FormatedTime = self:FormatTime(i)
- Maps.DollMap.LCD.Part.SurfaceGui.TextLabel.Text = FormatedTime
- wait(1)
- if #playerInDollGame == 0 then
- ShouldAnimateDoll = false
- wait(1)
- local rootLookVector = Doll.HumanoidRootPart.CFrame.LookVector
- local dollLookVector = Doll.Model.PrimaryPart.CFrame.LookVector
- local dot = rootLookVector:Dot(dollLookVector)
- if dot < 0 then
- local tweenInfo = TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
- local targetCFrame = Doll.Model.PrimaryPart.CFrame * CFrame.Angles(0, math.rad(180), 0)
- TweenService:Create(Doll.Model.PrimaryPart, tweenInfo, {CFrame = targetCFrame}):Play()
- end
- break
- end
- end
- if #playerInDollGame ~= 0 then
- for i, player in pairs(playerInDollGame) do
- local char = player.Character
- local humanoid = char:FindFirstChildOfClass("Humanoid")
- if humanoid then
- humanoid:TakeDamage(humanoid.MaxHealth)
- end
- end
- end
- end)
- end
- --Push tool variables
- local PUSH_FORCE = 30
- local MAX_DISTANCE = 10
- local COOL_PLAYER_UP = 2
- --Handling client-side behavior from the server using knit inbuilt signals
- --Handling some part of push tool in server when client calls this function
- function MapHandlerService.Client:PushTool(player, origin, direction)
- print("Runned Server")
- local lastUsed = {}
- local Pushes = player:FindFirstChild("Pushes")
- if not Pushes or Pushes.Value <= 0 then return end
- if tick() - (lastUsed[player] or 0) < COOL_PLAYER_UP then return end
- lastUsed[player] = tick()
- local rayParams = RaycastParams.new()
- rayParams.FilterDescendantsInstances = {player.Character}
- rayParams.FilterType = Enum.RaycastFilterType.Blacklist
- local ray = workspace:Raycast(origin, direction * MAX_DISTANCE, rayParams)
- if ray and ray.Instance and ray.Instance:IsDescendantOf(workspace) then
- local hitChar = ray.Instance:FindFirstAncestorOfClass("Model")
- local hitPlayer = hitChar and game.Players:GetPlayerFromCharacter(hitChar)
- if hitPlayer and hitPlayer.Character and hitPlayer.Character:FindFirstChild("HumanoidRootPart") then
- Pushes.Value -= 1
- print("Player Got Hitted: ", hitPlayer)
- local hrp = hitPlayer.HumanoidRootPart
- local bodyVel = Instance.new("BodyVelocity")
- bodyVel.MaxForce = Vector3.new(1e5, 0, 1e5)
- bodyVel.Velocity = direction * PUSH_FORCE
- bodyVel.Parent = hrp
- game.Debris:AddItem(bodyVel, 0.2)
- else
- print("Hit player not found")
- end
- end
- end
- --functio to increment player extra life by 1
- function MapHandlerService.Client:ExtraLifes(player:Player)
- local ExtraLifes = player:FindFirstChild("ExtraLifes")
- if ExtraLifes then
- ExtraLifes.Value += 1
- end
- end
- --function to give nametags to the players
- function MapHandlerService.Client:GiveNameTags(player:Player, TextColor)
- local NameTag = ReplicatedStorage.Assets:FindFirstChild("nametagui")
- if NameTag then
- if player.Character:FindFirstChild("Head"):FindFirstChild(NameTag.Name) then
- player.Character:FindFirstChild("Head"):FindFirstChild(NameTag.Name):Destroy()
- end
- local CloneNameTag = NameTag:Clone()
- CloneNameTag.Parent = player.Character:FindFirstChild("Head")
- CloneNameTag.ntframe.username.Text = player.Name
- CloneNameTag.ntframe.username.UIGradient.Enabled = false
- CloneNameTag.ntframe.username.TextColor3 = TextColor
- end
- end
- --function to give less gravity boost to player
- function MapHandlerService.Client:LessGravity(player:Player, argument)
- if argument == "IncreaseGravityValue" then
- local LessGravity = player:FindFirstChild("LessGravity")
- if LessGravity then
- LessGravity.Value += 1
- end
- else
- local LessGravity = player:FindFirstChild("LessGravity")
- if LessGravity then
- LessGravity.Value -= 1
- end
- end
- end
- --function to give brain rot to player character
- function MapHandlerService.Client:WearBrainRot(player:Player, AssetId, argument, RewardTemplate)
- local success, info = pcall(function()
- return game:GetService("MarketplaceService"):GetProductInfo(AssetId)
- end)
- local success, info = pcall(function()
- if argument == "Wear" then
- print(info)
- if not success then return end
- if info.AssetTypeId == 8 then
- for i, child in pairs(player.Character:GetDescendants()) do
- if child:IsA("Accessory") then
- if child.AccessoryType == Enum.AccessoryType.Hat then
- child:Destroy()
- end
- end
- end
- self.UpdateRewardStatus:Fire(player, RewardTemplate)
- local CloneAccessory = InsertService:LoadAsset(AssetId)
- if CloneAccessory:IsA("Model") then
- local Accessory = CloneAccessory:FindFirstChildOfClass("Accessory")
- Accessory.Parent = player.Character
- Accessory.AccessoryType = Enum.AccessoryType.Hat
- CloneAccessory:Destroy()
- end
- elseif info.AssetTypeId == 46 then
- for i, child in pairs(player.Character:GetDescendants()) do
- if child:IsA("Accessory") then
- if child.AccessoryType == Enum.AccessoryType.Neck then
- child:Destroy()
- end
- end
- end
- local CloneAccessory = InsertService:LoadAsset(AssetId)
- if CloneAccessory:IsA("Model") then
- local Accessory = CloneAccessory:FindFirstChildOfClass("Accessory")
- Accessory.Parent = player.Character
- Accessory.AccessoryType = Enum.AccessoryType.Neck
- CloneAccessory:Destroy()
- end
- elseif info.AssetTypeId == 42 then
- for i, child in pairs(player.Character:GetDescendants()) do
- if child:IsA("Accessory") then
- if child.AccessoryType == Enum.AccessoryType.Face then
- child:Destroy()
- end
- end
- end
- local CloneAccessory = InsertService:LoadAsset(AssetId)
- if CloneAccessory:IsA("Model") then
- local Accessory = CloneAccessory:FindFirstChildOfClass("Accessory")
- Accessory.Parent = player.Character
- Accessory.AccessoryType = Enum.AccessoryType.Hat
- CloneAccessory:Destroy()
- end
- elseif info.AssetTypeId == 67 then
- for i, child in pairs(player.Character:GetDescendants()) do
- if child:IsA("Accessory") then
- if child.AccessoryType == Enum.AccessoryType.LeftShoe then
- child:Destroy()
- end
- end
- end
- for i, child in pairs(player.Character:GetDescendants()) do
- if child:IsA("MeshPart") or child:IsA("BasePart") or child:IsA("Decal") then
- child.Transparency = 1
- end
- end
- local CloneAccessory = InsertService:LoadAsset(AssetId)
- if CloneAccessory:IsA("Model") then
- local Accessory = CloneAccessory:FindFirstChildOfClass("Accessory")
- Accessory.Parent = player.Character
- Accessory.AccessoryType = Enum.AccessoryType.LeftShoe
- CloneAccessory:Destroy()
- end
- end
- print("Runned")
- return true
- else
- if info.AssetTypeId == 8 then
- for i, child in pairs(player.Character:GetDescendants()) do
- if child:IsA("Accessory") then
- if child.AccessoryType == Enum.AccessoryType.Hat then
- child:Destroy()
- end
- end
- end
- elseif info.AssetTypeId == 46 then
- for i, child in pairs(player.Character:GetDescendants()) do
- if child:IsA("Accessory") then
- if child.AccessoryType == Enum.AccessoryType.Neck then
- child:Destroy()
- end
- end
- end
- elseif info.AssetTypeId == 42 then
- for i, child in pairs(player.Character:GetDescendants()) do
- if child:IsA("Accessory") then
- if child.AccessoryType == Enum.AccessoryType.Face then
- child:Destroy()
- end
- end
- end
- elseif info.AssetTypeId == 67 then
- for i, child in pairs(player.Character:GetDescendants()) do
- if child:IsA("Accessory") then
- if child.AccessoryType == Enum.AccessoryType.LeftShoe then
- child:Destroy()
- end
- end
- end
- for i, child in pairs(player.Character:GetDescendants()) do
- if child.Name == "HumanoidRootPart" then continue end
- if child:IsA("MeshPart") or child:IsA("BasePart") or child:IsA("Decal") then
- child.Transparency = 0
- end
- end
- end
- end
- return true
- end)
- end
- --This is the first function that runs after Knit starts. It manages the core functionality of the entire module, including the round system, developer products/gamepasses, timer, and more
- function MapHandlerService:KnitStart()
- self:DeveloperProductsHandler()
- repeat
- wait()
- until #game.Players:GetPlayers() > 0
- spawn(function()
- while wait() do
- for i, player in pairs(game.Players:GetPlayers()) do
- if player:WaitForChild("PlayerSelectedMode").Value ~= "Easy" then continue end
- self.Client.MusicEvent:Fire(player, "Play")
- end
- for i = 20, 0, -1 do
- if self:PlayersInEasyMode() == 0 then
- repeat
- wait(0.3)
- until self:PlayersInEasyMode() > 0
- end
- wait(1)
- print("Loop Running")
- for j, player in pairs(game.Players:GetPlayers()) do
- spawn(function()
- if player:WaitForChild("PlayerSelectedMode", math.huge).Value == "Easy" then
- local Success, Pcall = pcall(function()
- local RoundTimer = player.PlayerGui:WaitForChild("Timer"):WaitForChild("RoundTimer")
- if RoundTimer.Visible == false then RoundTimer.Visible = true end
- if RoundTimer then
- RoundTimer.Text = "Round Will Start In: "..i
- end
- if i == 0 then
- wait(1)
- RoundTimer.Visible = false
- end
- end)
- end
- end)
- end
- end
- for i, player in pairs(game.Players:GetPlayers()) do
- if player:WaitForChild("PlayerSelectedMode").Value ~= "Easy" then continue end
- self.Client.MusicEvent:Fire(player, "Stop")
- end
- warn("Runned Last")
- wait(1)
- self:RopeMap("Easy")
- repeat
- wait()
- until #PlayerInEasyRopeGame == 0
- wait(1)
- end
- end)
- while wait() do
- for i, player in pairs(game.Players:GetPlayers()) do
- if player:WaitForChild("PlayerSelectedMode").Value ~= "Hard" then continue end
- self.Client.MusicEvent:Fire(player, "Play")
- end
- for i = 20, 0, -1 do
- if self:PlayersInHardMode() == 0 then
- repeat
- wait(0.3)
- until self:PlayersInHardMode() > 0
- end
- wait(1)
- for j, player in pairs(game.Players:GetPlayers()) do
- spawn(function()
- if player:WaitForChild("PlayerSelectedMode", math.huge).Value == "Hard" then
- local Success, Pcall = pcall(function()
- local RoundTimer = player.PlayerGui:WaitForChild("Timer"):WaitForChild("RoundTimer")
- if RoundTimer.Visible == false then RoundTimer.Visible = true end
- if RoundTimer then
- RoundTimer.Text = "Round Will Start In: "..i
- end
- if i == 0 then
- wait(1)
- RoundTimer.Visible = false
- end
- end)
- end
- end)
- end
- end
- wait(1)
- for i, player in pairs(game.Players:GetPlayers()) do
- if player:WaitForChild("PlayerSelectedMode").Value ~= "Hard" then continue end
- self.Client.MusicEvent:Fire(player, "Stop")
- end
- self:RopeMap("Hard")
- repeat
- wait()
- until #PlayerInHardRopeGame == 0
- wait(1)
- end
- end
- return MapHandlerService
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement