Advertisement
Scripting_King

Untitled

Jun 30th, 2025
399
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 37.62 KB | Source Code | 0 0
  1. --[[
  2. Squid Game User Interface Controller
  3. Handles shop UI, reward UI, tool activation, gamepasses, animations, and GUI interaction logic using Knit framework.
  4. ]]
  5. --by the_king_here
  6. --//SERVICES
  7. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  8. local Knit = require(ReplicatedStorage.Packages.Knit)
  9. local TweenService = game:GetService("TweenService")
  10. local runService = game:GetService("RunService")
  11. local MPS = game:GetService("MarketplaceService")
  12. local LightningService = game:GetService("Lighting")
  13. local SoundService = game:GetService("SoundService")
  14.  
  15.  
  16. --TweenInfo config for UI transitions (0.3s, Back Out easing)
  17. local tweenInfoUI = TweenInfo.new(0.3, Enum.EasingStyle.Back, Enum.EasingDirection.Out, 0)
  18.  
  19. -- Creating a Knit Controller
  20. local UserInterfaceController = Knit.CreateController{
  21.     Name = "UserInterface",
  22. }
  23.  
  24. -- Will store reference to the server side service later
  25. local MapHandlerService
  26.  
  27. -- Reference to the local player
  28. local player = game.Players.LocalPlayer
  29.  
  30. -- Control module to disable movement during certain actions
  31. local Controls = require(player.PlayerScripts.PlayerModule):GetControls()
  32.  
  33. -- UI References in PlayerGui
  34. local TrollUI = player.PlayerGui:WaitForChild("Troll")
  35. local PushUI = player.PlayerGui:WaitForChild("PushUI")
  36. local SettingsUI = player.PlayerGui:WaitForChild("Settings")
  37. local ShopUI = player.PlayerGui:WaitForChild("Shop")
  38. local InventoryUI = player.PlayerGui:WaitForChild("Inventory")
  39. local RewardUI = player.PlayerGui:WaitForChild("Reward")
  40.  
  41. -- Music References
  42. local BackgroundMusic = SoundService:WaitForChild("LobbyMusic")
  43. local SquidMusic = SoundService:WaitForChild("Music")
  44.  
  45. -- Developer product IDs
  46. local Products = {
  47.     EliminatePlayers = 3312415657,
  48.     SpeedTroll = 3312416017,
  49.     KillRandomPersonTroll = 3312444642,
  50.     TakeCoinsTroll = 3312417586,
  51. }
  52.  
  53. -- Push upgrades (more force or quantity)
  54. local PushProducts = {
  55.     Push1 = 3313283431,
  56.     Push2 = 3313283430,
  57.     Push5 = 3313283433,
  58.     Push7 = 3313283424,
  59.     Push10 = 3313286623,
  60. }
  61.  
  62. -- Tweening for background music transitions
  63. local tweenInfoForMusic = TweenInfo.new(1.5, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, 0)
  64.  
  65. -- Reference to the camera for FOV changes
  66. local camera = workspace.CurrentCamera
  67.  
  68. -- Blur effect (GUI background blur)
  69. local Blur = LightningService:FindFirstChild("BlurForGui")
  70.  
  71. -- For rope animation disconnecting later
  72. local RopeAnimationConnection
  73.  
  74. -- Countdown before round starts (e.g., "3, 2, 1... Run!")
  75. function UserInterfaceController:BackTimer(StartTime, EndTime, UIToShowTime)
  76.     for i = StartTime, EndTime, -1 do
  77.         wait(1)
  78.         player.PlayerGui:WaitForChild("Timer").TextLabel.Visible = true
  79.         player.PlayerGui.Timer.TextLabel.Text = i --Displays time on textlabel
  80.         player.PlayerGui.Timer.TextLabel.TimerSound:Play() --plays timer sound every second
  81.         if i == 0 then
  82.             wait(1)
  83.             player.PlayerGui.Timer.TextLabel.Text = "Run!" -- Final message
  84.             task.delay(1.5, function()
  85.                 player.PlayerGui.Timer.TextLabel.Visible = false
  86.             end)
  87.         end
  88.     end
  89. end
  90.  
  91. -- Displays a short message on screen (centered label) for 3 seconds
  92. function UserInterfaceController:ShowMessage(Message)
  93.     player.PlayerGui:WaitForChild("Timer").TextLabel.Visible = true
  94.     player.PlayerGui.Timer.TextLabel.Text = Message
  95.     task.delay(3, function()
  96.         player.PlayerGui.Timer.TextLabel.Visible = false
  97.     end)
  98. end
  99.  
  100. local Rope -- rope part reference (used in Easy or Hard maps)
  101.  
  102. local maxSpeed -- max angular speed in radians/sec
  103. local accelTime = 3 -- how long to accelerate (ease in) in seconds
  104. local animationStarted = false -- variable to check if animation has started
  105. local animationStartTime = nil  -- server-synced time when animation begins
  106.  
  107. local initialCFrame -- store original rope CFrame
  108.  
  109. -- Begins rope rotation animation based on server time
  110. function UserInterfaceController:startAnimationWhenReady(serverStartTime, Mode)
  111.     -- Decide map + speed based on mode
  112.     if Mode == "Easy" then
  113.         maxSpeed = math.rad(210) -- degrees to radians
  114.         Rope = workspace.Maps.EasyRopemap:WaitForChild("rope")
  115.     else
  116.         maxSpeed = math.rad(250)
  117.         Rope = workspace.Maps.HadRopeMap:WaitForChild("rope")
  118.     end
  119.     local primary = Rope.PrimaryPart --Stores refrence to rope primaryPart
  120.     initialCFrame = primary.CFrame -- store starting position
  121.     animationStartTime = serverStartTime
  122.     animationStarted = false
  123.     Controls:Disable() -- Disable player movement during pre rope animation
  124.    
  125.     -- If player has LessGravity effect, set gravity to 70
  126.     local LessGravity = player:FindFirstChild("LessGravity")
  127.     if LessGravity.Value > 0 then
  128.         MapHandlerService:LessGravity("DecreaseGravityValue")
  129.         workspace.Gravity = 70
  130.     end
  131.  
  132.  
  133.     local IsEnabledControls = false --keep track whether controls of player has been restored or not
  134.     -- Connect to RenderStepped to animate rope every frame
  135.     RopeAnimationConnection = runService.RenderStepped:Connect(function()
  136.         local now = workspace:GetServerTimeNow() --get current time
  137.         -- Wait until server-synced animation time
  138.         if not animationStarted and now >= animationStartTime then
  139.             animationStarted = true
  140.         end
  141.         if not animationStarted then return end
  142.        
  143.         -- Enable player controls 1 second after rope starts
  144.         if not IsEnabledControls then
  145.             IsEnabledControls = true
  146.             task.delay(1, function()
  147.                 Controls:Enable()
  148.             end)
  149.         end
  150.  
  151.         local elapsed = now - animationStartTime -- how long since animation began
  152.         local rotation --Stores rotation value
  153.        
  154.         -- Accelerate with cubic easing for first 3 seconds
  155.         if elapsed < accelTime then
  156.             local progress = elapsed / accelTime
  157.             rotation = 0.33 * maxSpeed * (progress ^ 3) * accelTime
  158.         else
  159.             -- Maintain constant speed after acceleration phase
  160.             local constantTime = elapsed - accelTime
  161.             rotation = 0.33 * maxSpeed * accelTime + maxSpeed * constantTime
  162.         end
  163.        
  164.         -- Rotate rope by X-axis only
  165.         local newCFrame = initialCFrame * CFrame.Angles(rotation, 0, 0)
  166.         Rope:PivotTo(newCFrame)
  167.     end)
  168. end
  169.  
  170. --returns name after removing text "button" from name if name contains text "Button"
  171. function UserInterfaceController:getNameAfterRemovingButton(name)
  172.     local suffix = "Button"
  173.     if name:sub(-#suffix) == suffix then
  174.         return name:sub(1, -#suffix - 1)
  175.     else
  176.         return name
  177.     end
  178. end
  179.  
  180. local originalRotation = 0 --Stoers default rotation, which is usually 0
  181.  
  182. -- function to scale UDim2 (used to make buttons shrink or grow)
  183. function UserInterfaceController:scaleSize(size: UDim2, scale: number): UDim2
  184.     return UDim2.new(
  185.         size.X.Scale * scale, size.X.Offset * scale,
  186.         size.Y.Scale * scale, size.Y.Offset * scale
  187.     )
  188. end
  189.  
  190. -- When mouse enters button (hover), enlarge slightly + rotate
  191. function UserInterfaceController:onHover(button, originalSize)
  192.     local hoverTween = TweenService:Create(button, TweenInfo.new(0.1), {
  193.         Size = self:scaleSize(originalSize, 1.1),
  194.         Rotation = 5,
  195.     })
  196.     hoverTween:Play()
  197. end
  198.  
  199. -- When mouse leaves button, restore size and rotation
  200. function UserInterfaceController:onUnhover(button, originalSize)
  201.     local unhoverTween = TweenService:Create(button, TweenInfo.new(0.1), {
  202.         Size = originalSize,
  203.         Rotation = originalRotation,
  204.     })
  205.     unhoverTween:Play()
  206. end
  207.  
  208. -- When button is clicked, shrink quickly then bounce back
  209. function UserInterfaceController:onClick(button, originalSize)
  210.     local shrinkTween = TweenService:Create(button, TweenInfo.new(0.05), {
  211.         Size = self:scaleSize(originalSize, 0.8),
  212.     })
  213.     local restoreTween = TweenService:Create(button, TweenInfo.new(0.1), {
  214.         Size = originalSize,
  215.     })
  216.  
  217.     shrinkTween:Play()
  218.     shrinkTween.Completed:Connect(function()
  219.         restoreTween:Play()
  220.     end)
  221. end
  222. local OpenedUI -- tracks which UI is currently open
  223.  
  224. -- Applies hover/click logic and manages showing/hiding UIs like Shop, Inventory, etc.
  225. function UserInterfaceController:AnimateUIs()
  226.     local UIButtons = player.PlayerGui.Buttons
  227.  
  228.  
  229.     local Debounce = false -- prevents spam clicking
  230.  
  231.     for i, button in pairs(UIButtons:GetChildren()) do
  232.         if button:IsA("Frame") then
  233.             local Button = button:FindFirstChildOfClass("TextButton") -- Find the clickable button
  234.             if Button then
  235.                 local originalSize = button.Size
  236.                 local FrameName = self:getNameAfterRemovingButton(button.Name) -- Remove "Button" suffix
  237.                 local Frame = player.PlayerGui:FindFirstChild(FrameName) --get the frame with the given value after removing "Button" suffix
  238.                 if Frame.Name ~= "Modes" then
  239.                     -- if Normal UIs not Modes then use Frame.Canvas
  240.                     local CloseButton:ImageButton = Frame.Canvas.Container.Main.Close
  241.                     local Canavs = Frame:FindFirstChild("Canvas")
  242.                    
  243.                     -- Hover event
  244.                     button.MouseEnter:Connect(function()
  245.                         self:onHover(button, originalSize)
  246.                     end)
  247.                     -- Unhover event
  248.                     button.MouseLeave:Connect(function()
  249.                         self:onUnhover(button, originalSize)
  250.                     end)
  251.                    
  252.                     -- Button click (open/close logic)
  253.                     Button.MouseButton1Click:Connect(function()
  254.                         if Debounce then return end
  255.                         self:onClick(button, originalSize)
  256.                         Debounce = true
  257.                         if Frame then
  258.                            
  259.                             if not OpenedUI then -- No UI open yet
  260.                                 OpenedUI = Canavs --Defines the current open UI
  261.                                 Canavs.Visible = true
  262.                                 --Tweens the position of the UI
  263.                                 Canavs.Position = UDim2.new(0.5, 0, 1.5, 0)
  264.                                 Canavs:TweenPosition(UDim2.new(0.5, 0, 0.5, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Back, 0.3)
  265.                                
  266.                                 -- Zoom FOV and apply blur
  267.                                 TweenService:Create(camera, tweenInfoUI, {FieldOfView = 100}):Play()
  268.                                 TweenService:Create(Blur, tweenInfoUI, {Size = 20}):Play()
  269.                                 task.delay(0.3, function()
  270.                                     Debounce = false
  271.                                 end)
  272.                                
  273.                             elseif OpenedUI and OpenedUI ~= Canavs then-- Switching from one UI to another
  274.                                 Canavs.Visible = true
  275.                                 OpenedUI:TweenPosition(UDim2.new(0.5, 0, 1.5, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Back, 0.3)
  276.                                 OpenedUI = Canavs
  277.                                 Canavs.Position = UDim2.new(0.5, 0, 1.5, 0)
  278.                                 Canavs:TweenPosition(UDim2.new(0.5, 0, 0.5, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Back, 0.3)
  279.                                 TweenService:Create(camera, tweenInfoUI, {FieldOfView = 100}):Play()
  280.                                 TweenService:Create(Blur, tweenInfoUI, {Size = 20}):Play()
  281.                                 task.delay(0.3, function()
  282.                                     Debounce = false
  283.                                 end)
  284.                             elseif OpenedUI and OpenedUI == Canavs then -- UI is already open, so close it
  285.                                 OpenedUI = nil --closed opened UI so now no UI opened so make OpenedUI variable nil
  286.                                 Canavs:TweenPosition(UDim2.new(0.5, 0, 1.5, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Back, 0.3)
  287.                                 TweenService:Create(camera, tweenInfoUI, {FieldOfView = 70}):Play()
  288.                                 TweenService:Create(Blur, tweenInfoUI, {Size = 0}):Play()
  289.                                 task.delay(0.3, function()
  290.                                     Debounce = false
  291.                                 end)
  292.                             end
  293.                         end
  294.                     end)
  295.                    
  296.                     -- Close button logic/closes the opened UI
  297.                     CloseButton.MouseButton1Click:Connect(function()
  298.                         if Debounce then return end
  299.                         Debounce = true
  300.                         OpenedUI = nil
  301.                         --Closes UI with tween
  302.                         Canavs:TweenPosition(UDim2.new(0.5, 0, 1.5, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Back, 0.3)
  303.                         -- Reset camera FOV and continblur
  304.                         TweenService:Create(camera, tweenInfoUI, {FieldOfView = 70}):Play()
  305.                         TweenService:Create(Blur, tweenInfoUI, {Size = 0}):Play()
  306.                         task.delay(0.3, function()
  307.                             Debounce = false
  308.                         end)
  309.                     end)
  310.                 else -- This handles the "Modes" frame specifically
  311.  
  312.                     local CloseButton:ImageButton = Frame.Frame.Close -- Close button in a different hierarchy
  313.                     local Canavs = Frame:FindFirstChild("Frame") -- Canvas is named "Frame" here
  314.                    
  315.                     -- Hover events
  316.                     button.MouseEnter:Connect(function()
  317.                         self:onHover(button, originalSize)
  318.                     end)
  319.  
  320.                     button.MouseLeave:Connect(function()
  321.                         self:onUnhover(button, originalSize)
  322.                     end)
  323.                    
  324.                     -- Button clicked (toggle Modes UI)
  325.                     Button.MouseButton1Click:Connect(function()
  326.                         if Debounce then return end
  327.                         self:onClick(button, originalSize)
  328.                         Debounce = true
  329.                         if Frame then
  330.                             if not OpenedUI then -- First time opening
  331.                                 OpenedUI = Canavs
  332.                                 Canavs.Visible = true
  333.                                 Canavs.Position = UDim2.new(0.5, 0, 1.5, 0)
  334.                                 Canavs:TweenPosition(UDim2.new(0.5, 0, 0.5, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Back, 0.3)
  335.                                 TweenService:Create(camera, tweenInfoUI, {FieldOfView = 100}):Play()
  336.                                 TweenService:Create(Blur, tweenInfoUI, {Size = 20}):Play()
  337.                                 task.delay(0.3, function()
  338.                                     Debounce = false
  339.                                 end)
  340.                             elseif OpenedUI and OpenedUI ~= Canavs then -- Switching from another UI to this one
  341.                                 Canavs.Visible = true
  342.                                 OpenedUI:TweenPosition(UDim2.new(0.5, 0, 1.5, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Back, 0.3)
  343.                                 OpenedUI = Canavs
  344.                                 Canavs.Position = UDim2.new(0.5, 0, 1.5, 0)
  345.                                 Canavs:TweenPosition(UDim2.new(0.5, 0, 0.5, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Back, 0.3)
  346.                                 TweenService:Create(camera, tweenInfoUI, {FieldOfView = 100}):Play()
  347.                                 TweenService:Create(Blur, tweenInfoUI, {Size = 20}):Play()
  348.                                 task.delay(0.3, function()
  349.                                     Debounce = false
  350.                                 end)
  351.                             elseif OpenedUI and OpenedUI == Canavs then -- Close Modes UI
  352.                                 Debounce = true
  353.                                 OpenedUI = nil
  354.                                 Canavs:TweenPosition(UDim2.new(0.5, 0, 1.5, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Back, 0.3)
  355.                                 TweenService:Create(camera, tweenInfoUI, {FieldOfView = 70}):Play()
  356.                                 TweenService:Create(Blur, tweenInfoUI, {Size = 0}):Play()
  357.                                 task.delay(0.3, function()
  358.                                     Debounce = false
  359.                                 end)
  360.                             end
  361.                         end
  362.                     end)
  363.                    
  364.                     --Handles closeButton functionality
  365.                     CloseButton.MouseButton1Click:Connect(function()
  366.                         if Debounce then return end
  367.                         Debounce = true
  368.                         OpenedUI = nil
  369.                         Canavs:TweenPosition(UDim2.new(0.5, 0, 1.5, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Back, 0.3)
  370.                         TweenService:Create(camera, tweenInfoUI, {FieldOfView = 70}):Play()
  371.                         TweenService:Create(Blur, tweenInfoUI, {Size = 0}):Play()
  372.                         task.delay(0.3, function()
  373.                             Debounce = false
  374.                         end)
  375.                     end)
  376.                 end
  377.  
  378.             end
  379.         end
  380.     end
  381. end
  382.  
  383.  
  384. --Handles working of troll UI
  385. function UserInterfaceController:TrollUI()
  386.     local UIStroke
  387.     -- Loop through each troll button (ImageButton inside Main Container)
  388.     for i, trolls in pairs(TrollUI.Canvas.Container.Main.Container:GetChildren()) do
  389.         if trolls:IsA("ImageButton") then
  390.             trolls.MouseEnter:Connect(function() -- When hovered, add purple UIStroke around "Default" image
  391.                 print("Entered")
  392.                 if not UIStroke then
  393.                     UIStroke = Instance.new("UIStroke")
  394.                     UIStroke.Parent = trolls:FindFirstChild("Default")
  395.                     UIStroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Contextual
  396.                     UIStroke.Color = Color3.fromRGB(126, 36, 233)
  397.                     UIStroke.Thickness = 2
  398.                 else
  399.                     UIStroke.Parent = trolls:FindFirstChild("Default")
  400.                 end
  401.             end)
  402.            
  403.             -- Remove stroke on mouse leave
  404.             trolls.MouseLeave:Connect(function()
  405.                 UIStroke.Parent = nil
  406.             end)
  407.            
  408.             -- Refrence to the buy button inside Equipped or Default
  409.             local BuyButton:ImageButton = trolls.Equipped:FindFirstChild("Buy") or trolls.Default:FindFirstChild("Buy")
  410.            
  411.             -- When clicked, trigger Marketplace purchase for selected troll type
  412.             BuyButton.MouseButton1Click:Connect(function()
  413.                 local ClickedTrollName = BuyButton.Parent.Parent.Name
  414.                 if ClickedTrollName == "EliminatePlayers" then
  415.                     MPS:PromptProductPurchase(player, Products.EliminatePlayers)
  416.                 elseif ClickedTrollName == "SpeedTroll" then
  417.                     MPS:PromptProductPurchase(player, Products.SpeedTroll)
  418.                 elseif ClickedTrollName == "KillRandomPersonTroll" then
  419.                     MPS:PromptProductPurchase(player, Products.KillRandomPersonTroll)
  420.                 elseif ClickedTrollName == "TakeCoinsTroll" then
  421.                     MPS:PromptProductPurchase(player, Products.TakeCoinsTroll)
  422.                 end
  423.             end)
  424.         end
  425.     end
  426. end
  427.  
  428.  
  429.  
  430. function UserInterfaceController:PushIUI()
  431.     local UIStroke
  432.    
  433.     -- Loop through each push product (Push1, Push2, etc.)
  434.     for i, trolls in pairs(PushUI.Canvas.Container.Main.Container:GetChildren()) do
  435.         if trolls:IsA("ImageButton") then
  436.             trolls.MouseEnter:Connect(function()-- Same hover stroke logic as TrollUI
  437.                 print("Entered")
  438.                 if not UIStroke then
  439.                     UIStroke = Instance.new("UIStroke")
  440.                     UIStroke.Parent = trolls:FindFirstChild("Default")
  441.                     UIStroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Contextual
  442.                     UIStroke.Color = Color3.fromRGB(126, 36, 233)
  443.                     UIStroke.Thickness = 2
  444.                 else
  445.                     UIStroke.Parent = trolls:FindFirstChild("Default")
  446.                 end
  447.             end)
  448.  
  449.             trolls.MouseLeave:Connect(function()
  450.                 UIStroke.Parent = nil
  451.             end)
  452.            
  453.             -- Find Buy button
  454.             local BuyButton:ImageButton = trolls.Equipped:FindFirstChild("Buy") or trolls.Default:FindFirstChild("Buy")
  455.            
  456.             -- Trigger MarketplaceService purchase when clickedcont
  457.             BuyButton.MouseButton1Click:Connect(function()
  458.                 local ClickedButtonName = BuyButton.Parent.Parent.Name
  459.                 if ClickedButtonName == "Push1" then
  460.                     MPS:PromptProductPurchase(player, PushProducts.Push1)
  461.                 elseif ClickedButtonName == "Push2" then
  462.                     MPS:PromptProductPurchase(player, PushProducts.Push2)
  463.                 elseif ClickedButtonName == "Push5" then
  464.                     MPS:PromptProductPurchase(player, PushProducts.Push5)
  465.                 elseif ClickedButtonName == "Push7" then
  466.                     MPS:PromptProductPurchase(player, PushProducts.Push7)
  467.                 elseif ClickedButtonName == "Push10" then
  468.                     MPS:PromptProductPurchase(player, PushProducts.Push10)
  469.                 end
  470.             end)
  471.         end
  472.     end
  473. end
  474.  
  475. local ClonedPopupUI
  476.  
  477. function UserInterfaceController:ShopeUI()
  478.     local UIStroke
  479.  
  480.     local NavigationList = ShopUI.Canvas.Container.Navigation.List
  481.  
  482.     local PopupUI = player.PlayerGui.Popup -- Refrence to popup UI
  483.  
  484.     local GamepassButton = NavigationList.Gamepass
  485.     local DeveloperProductsButton = NavigationList.DeveloperProducts
  486.     local StoreButton = NavigationList.Store
  487.  
  488.     local Container1 = ShopUI.Canvas.Container.Main.Container1 -- Gamepasses Tab
  489.     local Container2 = ShopUI.Canvas.Container.Main.Container2 -- Dev Products Tab
  490.     local Container3 = ShopUI.Canvas.Container.Main.Container3 -- Store Items Tab
  491.    
  492.     -- Gamepass tab button logic
  493.     NavigationList.Gamepass.MouseButton1Click:Connect(function()
  494.         if Container2.Visible == true or Container3.Visible == true then
  495.             Container2.Visible = false -- Hide other tabs
  496.             Container3.Visible = false
  497.             Container1.Visible = true  -- Show gamepasses Tab
  498.            
  499.             -- Change looking style of tab buttons
  500.             GamepassButton.BackgroundColor3 = Color3.fromRGB(255, 255, 255) --Change background color to white so UI gradient get clearly visible
  501.             GamepassButton:FindFirstChild("UIGradient").Enabled = true --Enable UI gradient
  502.             GamepassButton.Text.TextColor3 = Color3.new(255, 255, 255) --Change text color to white too
  503.  
  504.             DeveloperProductsButton.BackgroundColor3 = Color3.fromRGB(31, 31, 31)--Change background color to black
  505.             DeveloperProductsButton:FindFirstChild("UIGradient").Enabled = false--Disble UI gradient
  506.             DeveloperProductsButton.Text.TextColor3 = Color3.new(113, 113, 113)--Change text color to white
  507.  
  508.             StoreButton.BackgroundColor3 = Color3.fromRGB(31, 31, 31) --Change background color to black
  509.             StoreButton:FindFirstChild("UIGradient").Enabled = false --Disble UI gradient
  510.             StoreButton.Text.TextColor3 = Color3.new(113, 113, 113) --Change text color to white
  511.         end
  512.     end)
  513.    
  514.     --Developer Products tab Button logic
  515.     NavigationList.DeveloperProducts.MouseButton1Click:Connect(function()
  516.         if Container1.Visible == true or Container3.Visible == true then
  517.             Container2.Visible = true
  518.             Container3.Visible = false
  519.             Container1.Visible = false
  520.             DeveloperProductsButton.BackgroundColor3 = Color3.fromRGB(255, 255, 255)--Change background color to white so UI gradient get clearly visible
  521.             DeveloperProductsButton:FindFirstChild("UIGradient").Enabled = true--Enable UI gradient
  522.             DeveloperProductsButton.Text.TextColor3 = Color3.new(255, 255, 255) --Change text color to white too
  523.  
  524.             GamepassButton.BackgroundColor3 = Color3.fromRGB(31, 31, 31) --Change background color to black
  525.             GamepassButton:FindFirstChild("UIGradient").Enabled = false --Disble UI gradient
  526.             GamepassButton.Text.TextColor3 = Color3.new(113, 113, 113) --Change text color to white
  527.  
  528.             StoreButton.BackgroundColor3 = Color3.fromRGB(31, 31, 31)--Change background color to black
  529.             StoreButton:FindFirstChild("UIGradient").Enabled = false --Disble UI gradient
  530.             StoreButton.Text.TextColor3 = Color3.new(113, 113, 113) --Change text color to white
  531.         end
  532.     end)
  533.    
  534.     -- Store tab button logic
  535.     NavigationList.Store.MouseButton1Click:Connect(function()
  536.         if Container1.Visible == true or Container2.Visible == true then
  537.             Container3.Visible = true
  538.             Container1.Visible = false
  539.             Container2.Visible = false
  540.             StoreButton.BackgroundColor3 = Color3.fromRGB(255, 255, 255)--Change background color to white so UI gradient get clearly visible
  541.             StoreButton:FindFirstChild("UIGradient").Enabled = true --Enable UI gradient
  542.             StoreButton.Text.TextColor3 = Color3.new(255, 255, 255) --Change text color to white too
  543.  
  544.             GamepassButton.BackgroundColor3 = Color3.fromRGB(31, 31, 31) --Change background color to black
  545.             GamepassButton:FindFirstChild("UIGradient").Enabled = false--Disble UI gradient
  546.             GamepassButton.Text.TextColor3 = Color3.new(113, 113, 113)--Change text color to white
  547.  
  548.             DeveloperProductsButton.BackgroundColor3 = Color3.fromRGB(31, 31, 31)--Change background color to black
  549.             DeveloperProductsButton:FindFirstChild("UIGradient").Enabled = false--Disble UI gradient
  550.             DeveloperProductsButton.Text.TextColor3 = Color3.new(113, 113, 113)--Change text color to white
  551.         end
  552.     end)
  553.    
  554.     -- Loop through items in Container1 (Gamepasses)
  555.     for i, Gamepass in pairs(Container1:GetChildren()) do
  556.         if Gamepass:IsA("ImageButton") then
  557.             -- Hover effect
  558.             Gamepass.MouseEnter:Connect(function()
  559.                 if not UIStroke then
  560.                     UIStroke = Instance.new("UIStroke")
  561.                     UIStroke.Parent = Gamepass:FindFirstChild("Default")
  562.                     UIStroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Contextual
  563.                     UIStroke.Color = Color3.fromRGB(126, 36, 233)
  564.                     UIStroke.Thickness = 2
  565.                 else
  566.                     UIStroke.Parent = Gamepass:FindFirstChild("Default")
  567.                 end
  568.             end)
  569.  
  570.             Gamepass.MouseLeave:Connect(function()
  571.                 UIStroke.Parent = nil
  572.             end)
  573.            
  574.             -- Giving refrence to buy button
  575.             local BuyButton:ImageButton = Gamepass.Equipped:FindFirstChild("Buy") or Gamepass.Default:FindFirstChild("Buy")
  576.            
  577.             -- Handle Gamepass purchase via MarketplaceService after clicking buy button
  578.             BuyButton.MouseButton1Click:Connect(function()
  579.                 local ClickedButtonName = BuyButton.Parent.Parent.Name
  580.                 if ClickedButtonName == "Coins2x" then
  581.                     MPS:PromptGamePassPurchase(player, 1272744022)
  582.                 elseif ClickedButtonName == "Sprint" then
  583.                     MPS:PromptGamePassPurchase(player, 1273130340)
  584.                 elseif ClickedButtonName == "RainbowNameTag" then
  585.                     MPS:PromptGamePassPurchase(player, 1274510513)
  586.                 end
  587.             end)
  588.         end
  589.     end
  590.  
  591.     for i, Gamepass in pairs(Container2:GetChildren()) do
  592.         if Gamepass:IsA("ImageButton") then
  593.             Gamepass.MouseEnter:Connect(function()
  594.                 -- Same UIStroke hover logic
  595.                 if not UIStroke then
  596.                     UIStroke = Instance.new("UIStroke")
  597.                     UIStroke.Parent = Gamepass:FindFirstChild("Default")
  598.                     UIStroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Contextual
  599.                     UIStroke.Color = Color3.fromRGB(126, 36, 233)
  600.                     UIStroke.Thickness = 2
  601.                 else
  602.                     UIStroke.Parent = Gamepass:FindFirstChild("Default")
  603.                 end
  604.             end)
  605.  
  606.             Gamepass.MouseLeave:Connect(function()
  607.                 UIStroke.Parent = nil
  608.             end)
  609.  
  610.             local BuyButton:ImageButton = Gamepass.Equipped:FindFirstChild("Buy") or Gamepass.Default:FindFirstChild("Buy")
  611.             -- Trigger product purchases
  612.             BuyButton.MouseButton1Click:Connect(function()
  613.                 local ClickedButtonName = BuyButton.Parent.Parent.Name
  614.                 if ClickedButtonName == "Coins50" then
  615.                     MPS:PromptProductPurchase(player, 3314212399)
  616.                 elseif ClickedButtonName == "Coins100" then
  617.                     MPS:PromptProductPurchase(player, 3314212620)
  618.                 elseif ClickedButtonName == "Coins300" then
  619.                     MPS:PromptProductPurchase(player, 3314213085)
  620.                 elseif ClickedButtonName == "Coins500" then
  621.                     MPS:PromptProductPurchase(player, 3314213295)
  622.                 elseif ClickedButtonName == "Coins1000" then
  623.                     MPS:PromptProductPurchase(player, 3314214142)
  624.                 end
  625.             end)
  626.         end
  627.     end
  628.  
  629.     for i, Gamepass in pairs(Container3:GetChildren()) do
  630.         if Gamepass:IsA("ImageButton") then
  631.             Gamepass.MouseEnter:Connect(function()
  632.                 -- Hover stroke (same as above)
  633.                 if not UIStroke then
  634.                     UIStroke = Instance.new("UIStroke")
  635.                     UIStroke.Parent = Gamepass:FindFirstChild("Default")
  636.                     UIStroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Contextual
  637.                     UIStroke.Color = Color3.fromRGB(126, 36, 233)
  638.                     UIStroke.Thickness = 2
  639.                 else
  640.                     UIStroke.Parent = Gamepass:FindFirstChild("Default")
  641.                 end
  642.             end)
  643.  
  644.             Gamepass.MouseLeave:Connect(function()
  645.                 UIStroke.Parent = nil
  646.             end)
  647.            
  648.             -- Button purchase logic
  649.             local BuyButton:ImageButton = Gamepass.Equipped:FindFirstChild("Buy") or Gamepass.Default:FindFirstChild("Buy")
  650.  
  651.             BuyButton.MouseButton1Click:Connect(function()
  652.                 -- Clone and display popup
  653.                 ClonedPopupUI = PopupUI:Clone()
  654.                 ClonedPopupUI.Parent = player.PlayerGui
  655.  
  656.                 ClonedPopupUI.Canvas.Visible = true
  657.                
  658.                 -- open ColourWheel if buy button is of NameTags template
  659.                 if BuyButton.Parent.Parent.Name == "NameTags" then
  660.                     player.PlayerGui.ColourWheelGui.Enabled = true
  661.                 end
  662.  
  663.                 -- Handle purchase proccess if player has enough coins
  664.                 ClonedPopupUI.Canvas.Main.YesButton.MouseButton1Click:Connect(function()
  665.                     local PlayerCoins = player:FindFirstChild("leaderstats"):WaitForChild("Coins")
  666.                     if PlayerCoins and PlayerCoins.Value >= BuyButton.Cost.Value then
  667.                         PlayerCoins.Value -= BuyButton.Cost.Value
  668.  
  669.                         -- Handle NameTags (with color)
  670.                         if BuyButton.Parent.Parent.Name == "NameTags" then
  671.                             local NameTag = ReplicatedStorage.Assets:FindFirstChild("nametagui"):Clone()
  672.                             MapHandlerService:GiveNameTags(player.PlayerGui.ColourWheelGui.ColourDisplay.BackgroundColor3)
  673.                             player.PlayerGui.ColourWheelGui.Enabled = false
  674.                             ClonedPopupUI:Destroy()
  675.                         else
  676.                             -- Add cloned template to Inventory
  677.                             local CloneTemplate = BuyButton.Parent.Parent:Clone()
  678.                             CloneTemplate.Parent = InventoryUI.Canvas.Container.Main.Container
  679.                             CloneTemplate.Default.Buy:Destroy()
  680.                             ClonedPopupUI:Destroy()
  681.                         end
  682.                     else
  683.                         -- Not enough coins message
  684.                         ClonedPopupUI.Canvas.Main.YesButton.Main.TextLabel.Text = "Not Enough Coins!"
  685.                         task.delay(2, function()
  686.                             ClonedPopupUI.Canvas.Main.YesButton.Main.TextLabel.Text = "Buy"
  687.                         end)
  688.                     end
  689.                 end)
  690.                
  691.                 -- Popup close logic (X button or "Close")
  692.                 ClonedPopupUI.Canvas.Main.Closebutton.MouseButton1Click:Connect(function()
  693.                     ClonedPopupUI:Destroy()
  694.                 end)
  695.  
  696.                 ClonedPopupUI.Canvas.Main.Close.MouseButton1Click:Connect(function()
  697.                     ClonedPopupUI:Destroy()
  698.                 end)
  699.                
  700.                 -- gives player option to buy with robux if player don't have enough coins
  701.                 ClonedPopupUI.Canvas.Main.BuyWithRobux.MouseButton1Click:Connect(function()
  702.                     local itemName = BuyButton.Parent.Parent.Name
  703.                     if itemName == "ExtraLifes" then
  704.                         MPS:PromptProductPurchase(player, 3314996213)
  705.                     elseif itemName == "LessGravity" then
  706.                         MPS:PromptProductPurchase(player, 3314996574)
  707.                     elseif itemName == "NameTags" then
  708.                         MPS:PromptProductPurchase(player, 3314996930)
  709.                     end
  710.                 end)
  711.             end)
  712.         end
  713.     end
  714. end
  715.  
  716. function UserInterfaceController:InventoryHandler()
  717.     local Container = InventoryUI.Canvas.Container.Main.Container -- refrence to hte frame that holds item buttons
  718.     local SidePanel = InventoryUI.Canvas.Container.Main.SidePanel -- refrence to the frame that shows selected item details
  719.  
  720.     local SelectedChild -- Currently selected item
  721.    
  722.     -- Setup UIStroke for selection outline
  723.     local UIStroke = Instance.new("UIStroke")
  724.     UIStroke.Parent = nil
  725.     UIStroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Contextual
  726.     UIStroke.Color = Color3.fromRGB(126, 36, 233)
  727.     UIStroke.Thickness = 2
  728.    
  729.     -- Use button logic
  730.     SidePanel.Use.MouseButton1Click:Connect(function()
  731.         if SidePanel.ItemName.Text == "ExtraLifes" then
  732.             MapHandlerService:ExtraLifes() --Calls "ExtraLifes" function
  733.             SelectedChild:Destroy() -- Consume/Remove item
  734.             SidePanel.ImageLabel.Image = ""
  735.             SidePanel.ItemName.Text = "ItemName"
  736.             SidePanel.ItemDescription.Text = "ItemDescription"
  737.         elseif SidePanel.ItemName.Text == "LessGravity" then
  738.             MapHandlerService:LessGravity("IncreaseGravityValue") --Calls "LessGravity" function
  739.         end
  740.     end)
  741.    
  742.     -- When new item added to inventory
  743.     Container.ChildAdded:Connect(function(child:ImageButton)
  744.         child.MouseButton1Click:Connect(function()
  745.             if not SelectedChild or SelectedChild ~= child then
  746.                 SelectedChild = child
  747.                 UIStroke.Parent = child:FindFirstChild("Default")
  748.                 -- Update side panel
  749.                 SidePanel.ItemName.Text = child.Name
  750.                 SidePanel.ImageLabel.Image = child.Default.ImageLabel.Image
  751.                 SidePanel.ItemDescription.Text = child.Default.TextLabel.Text
  752.             end
  753.         end)
  754.     end)
  755. end
  756.  
  757. -- Format seconds into MM:SS format
  758. function UserInterfaceController:FormatTime(seconds)
  759.     seconds = math.max(0, math.floor(seconds))
  760.  
  761.     local minutes = math.floor(seconds / 60)
  762.     local secs = seconds % 60
  763.  
  764.     return string.format("%02d:%02d", minutes, secs)
  765. end
  766.  
  767. -- Unlock times for rewards (in seconds)
  768. local TimeToUnlock = {
  769.     Reward1 = 5 * 60,
  770.     Reward2 = 10 * 60,
  771.     Reward3 = 15 * 60,
  772.     Reward4 = 20 * 60,
  773.     Reward5 = 25 * 60,
  774.     Reward6 = 30 * 60,
  775.     Reward7 = 35 * 60,
  776. }
  777.  
  778. function UserInterfaceController:RewardUI()
  779.     local UIStroke
  780.  
  781.     local StartTime = tick() --returns the number of seconds since January 1st, 1970 UTC, useful for time elapsed calculations
  782.    
  783.     -- Update timer every second
  784.     spawn(function()
  785.         while wait(1) do
  786.             for i, rewards in pairs(RewardUI.Canvas.Container.Main.Container:GetChildren()) do
  787.                 if rewards:IsA("ImageButton") then
  788.                     if rewards.Equipped.TextLabel.Text == "Unlock in: 00:00" then continue end
  789.                     rewards.Equipped.TextLabel.Text = "Unlock in: ".. self:FormatTime(TimeToUnlock[rewards.Name] - (tick() - StartTime)) --Update the rewards time after formating seconds into MM:SS format
  790.                     if rewards.Equipped.TextLabel.Text == "Unlock in: 00:00" then
  791.                         rewards.Equipped.Buy.Backing.Text.Text = "Equip" --if timer is reached 0 sec it changes rewards button text to equip
  792.                     end
  793.                 end
  794.             end
  795.         end
  796.     end)
  797.    
  798.     --loop through all the rewards available in reward UI container/scrolling Frame
  799.     for i, Rewards in pairs(RewardUI.Canvas.Container.Main.Container:GetChildren()) do
  800.         if Rewards:IsA("ImageButton") then
  801.             Rewards.MouseEnter:Connect(function()
  802.                 --same UIStroke logic
  803.                 if not UIStroke then
  804.                     UIStroke = Instance.new("UIStroke")
  805.                     UIStroke.Parent = Rewards:FindFirstChild("Default")
  806.                     UIStroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Contextual
  807.                     UIStroke.Color = Color3.fromRGB(126, 36, 233)
  808.                     UIStroke.Thickness = 2
  809.                 else
  810.                     UIStroke.Parent = Rewards:FindFirstChild("Default")
  811.                 end
  812.             end)
  813.            
  814.             --remove UIStroke after player leaves the button
  815.             Rewards.MouseLeave:Connect(function()
  816.                 UIStroke.Parent = nil
  817.             end)
  818.            
  819.             --refrence to buy button
  820.             local EquipButton:ImageButton = Rewards.Equipped:FindFirstChild("Buy") or Rewards.Default:FindFirstChild("Buy")
  821.  
  822.             local EquippedHat --last equipped Hat accessory
  823.             local EquippedNeck --Last equipped neck accessory
  824.             local EquippedFace --last equipped fconace accessory
  825.            
  826.             --handles equip button logic
  827.             EquipButton.MouseButton1Click:Connect(function()
  828.                 if EquipButton.Backing.Text.Text == "Locked yet!" then return end --if item is currently lock then stop execution of event immediately
  829.                 if EquipButton.Backing.Text.Text == "Unequip" then --if player has already equipped item then unEquip it
  830.                     local Success, errorMessage = MapHandlerService:WearBrainRot(Rewards:FindFirstChild("AssetId").Value, Rewards)
  831.                     if Success then
  832.                         EquipButton.Backing.Text.Text = "Equip"
  833.                     end
  834.                 else --if player has not equipped item then equip it
  835.                     local Success, errorMessage = MapHandlerService:WearBrainRot(Rewards:FindFirstChild("AssetId").Value, "Wear", Rewards)
  836.                     if Success then
  837.                         EquipButton.Backing.Text.Text = "Unequip"
  838.                     end
  839.                 end
  840.             end)
  841.         end
  842.     end
  843. end
  844.  
  845. --handles logics of setting UI
  846. function UserInterfaceController:SettignsUI()
  847.     for i, Settings in pairs(SettingsUI.Canvas.Container.Main.Container:GetChildren()) do
  848.         if Settings:IsA("ImageLabel") then
  849.             local ToggleButton = Settings:FindFirstChild("ToggleButton")
  850.             if ToggleButton then
  851.                 --Event which runs upon toggle button is clicked using left mouse button
  852.                 ToggleButton.MouseButton1Click:Connect(function()
  853.  
  854.                     -- Determine toggle state
  855.                     local turningOff = Settings.Background.Toggle.ActiveFrame.Visible == true
  856.  
  857.                     Settings.Background.Toggle.ActiveFrame.Visible = not turningOff
  858.                     Settings.Background.Toggle.InactiveFrame.Visible = turningOff
  859.  
  860.                     -- Loop through all other players
  861.                     for _, Player in pairs(game.Players:GetPlayers()) do
  862.                         if Player == player then continue end
  863.                         local char = Player.Character
  864.                         if not char then return end
  865.  
  866.                         for _, child in pairs(char:GetDescendants()) do
  867.                             if child:IsA("MeshPart") or child:IsA("BasePart") or child:IsA("Decal") then --This condition will only execute if the child is a type of "BasePart" Or "MeshPart" or "Decal"
  868.                                 if child.Name == "HumanoidRootPart" then continue end
  869.                                 child.Transparency = turningOff and 0 or 1 -- Hide or show
  870.                             end
  871.                         end
  872.                     end
  873.                 end)
  874.             end
  875.         end
  876.     end
  877. end
  878.  
  879.  
  880.  
  881.  
  882. function UserInterfaceController:KnitInit()
  883.     MapHandlerService = Knit.GetService("MapHandlerService") -- Fetch server-side service
  884.    
  885.     -- Init all UI features
  886.     self:TrollUI()
  887.     self:PushIUI()
  888.     self:AnimateUIs()
  889.     self:SettignsUI()
  890.     self:ShopeUI()
  891.     self:RewardUI()
  892.     self:InventoryHandler()
  893.    
  894.     -- Show round countdown
  895.     MapHandlerService.Timer:Connect(function()
  896.         self:BackTimer()
  897.     end)
  898.    
  899.     -- Display a center-screen message from the server
  900.     MapHandlerService.Message:Connect(function(Message)
  901.         self:ShowMessage(Message)
  902.     end)
  903.    
  904.     -- Rope animation controller from server
  905.     MapHandlerService.AnimateRopes:Connect(function(serverStartTime, Mode)
  906.         self:startAnimationWhenReady(serverStartTime, Mode)
  907.     end)
  908.    
  909.     --blocks player from returning back into the track after he has ended the round
  910.     MapHandlerService.BlockGoingBack:Connect(function(mode)
  911.         if mode == "Easy" then
  912.             workspace.Maps.EasyRopemap:WaitForChild("FinishPoint").CanCollide = true
  913.         else
  914.             workspace.Maps.HadRopeMap:WaitForChild("FinishPoint").CanCollide = true
  915.         end
  916.     end)
  917.  
  918.     MapHandlerService.UpdateRewardStatus:Connect(function(RewardTemplate)
  919.         for i, reward in pairs(player.PlayerGui.Reward.Canvas.Container.Main.Container:GetChildren()) do
  920.             if reward:IsA("ImageButton") then
  921.                 -- Don’t change text if equip button text is "Locked yet!"
  922.                 if reward.Equipped.Buy.Backing.Text.Text == "Locked yet!" then continue end
  923.                 -- Deselect all others if the same asset type is equipped/it changes text back to equip if the same asset type has text "Unequip"
  924.                 if reward:FindFirstChild("AssetType").Value == "Hat" and reward ~= RewardTemplate then
  925.                     reward.Equipped.Buy.Backing.Text.Text = "Equip"
  926.                 end
  927.             end
  928.         end
  929.     end)
  930.    
  931.     --calls the server function for adding nametags to player head so it is visible to everyone
  932.     MapHandlerService.NameTag:Connect(function()
  933.         if ClonedPopupUI then
  934.             ClonedPopupUI:Destroy()
  935.         end
  936.         player.PlayerGui.ColourWheelGui.Enabled = false
  937.         MapHandlerService:GiveNameTags(player.PlayerGui.ColourWheelGui.ColourDisplay.BackgroundColor3)
  938.     end)
  939.    
  940.     --Handles music playing/stopping with tween/amimation
  941.     MapHandlerService.MusicEvent:Connect(function(argument)
  942.         if argument == "Play" then
  943.             player.PlayerGui.Buttons.ModesButton.Visible = true
  944.             BackgroundMusic:Play()
  945.             BackgroundMusic.Volume = 0
  946.             TweenService:Create(BackgroundMusic, tweenInfoForMusic, {Volume = 0.25}):Play()
  947.         elseif argument == "Stop" then
  948.             player.PlayerGui.Buttons.ModesButton.Visible = false
  949.             OpenedUI = nil
  950.             player.PlayerGui.Modes.Frame:TweenPosition(UDim2.new(0.5, 0, 1.5, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Back, 0.3)
  951.             TweenService:Create(camera, tweenInfoUI, {FieldOfView = 70}):Play()
  952.             TweenService:Create(Blur, tweenInfoUI, {Size = 0}):Play()
  953.             TweenService:Create(BackgroundMusic, tweenInfoForMusic, {Volume = 0}):Play()
  954.            
  955.             -- Stop after fade-out
  956.             task.delay(1.5, function()
  957.                 wait(1.5)
  958.                 BackgroundMusic:Stop()
  959.             end)
  960.         end
  961.     end)
  962.    
  963.     -- Handles squid game music playing/stopping with the round start/ends
  964.     MapHandlerService.SquidMusic:Connect(function(argument)
  965.         if argument == "Play" then
  966.             SquidMusic:Play()
  967.             SquidMusic.Volume = 0
  968.             TweenService:Create(SquidMusic, tweenInfoForMusic, {Volume = 0.25}):Play()
  969.         elseif argument == "Stop" then
  970.             TweenService:Create(SquidMusic, tweenInfoForMusic, {Volume = 0}):Play()
  971.             task.delay(1.5, function()
  972.                 wait(1.5)
  973.                 SquidMusic:Stop()
  974.             end)
  975.         end
  976.     end)
  977.  
  978.     MapHandlerService.RoundEnd:Connect(function(mode)
  979.         if RopeAnimationConnection then
  980.             RopeAnimationConnection:Disconnect()
  981.             Rope:PivotTo(initialCFrame)
  982.             if mode == "Easy" then --change the easy/hard map finish point's CanCollide property to false depending on mode
  983.                 workspace.Maps.EasyRopemap:WaitForChild("FinishPoint").CanCollide = false
  984.             else
  985.                 workspace.Maps.HadRopeMap:WaitForChild("FinishPoint").CanCollide = false
  986.             end
  987.             workspace.Gravity = 196.2 -- Restore normal gravity for those who have bought "LessGravity" Developer product
  988.         end
  989.     end)
  990.  
  991. end
  992.  
  993. return UserInterfaceController
Tags: #scripting
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement