Advertisement
TIDETER

BoostIntensity

Jun 30th, 2025
321
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.25 KB | None | 0 0
  1. Remotes.BoostIntensity.OnServerEvent:Connect(function(Player : Player, Agreed : Boolean, PassKey : Number)
  2.     if not Game.Info.BoostingEnabled then
  3.         return Remotes.Alert:FireClient(Player, "Boosting is disabled")
  4.     end
  5.    
  6.     if not FE2Library.BoostCosts[Game.Info.BoostCount+1] then
  7.         return Remotes.Alert:FireClient(Player, "Max number of boosts reached!")
  8.     end
  9.    
  10.     if Game.Info.Intensity + Functions.GetIntensityChange(0, Game.Info.Difficulty, Game.Info.BoostedIntensity) >= 5.99 then
  11.         return Remotes.Alert:FireClient(Player, "Max intensity has already been guaranteed!")  
  12.     end
  13.    
  14.     local Profile = DataModule.getProfile(Player)  
  15.     local PlayerData = Profile.playerData
  16.     local OwnsGamePass = table.find(Profile.ownedGamepasses, 14784835)
  17.     local TwoX = OwnsGamePass and 1 or 0.5
  18.     local boostCost = FE2Library.BoostCosts[Game.Info.BoostCount+1]
  19.    
  20.     if (not Agreed) and Game.Info.BoostCount > 1 then
  21.         return ReplicatedStorage.Remote.BoostIntensity:FireClient(Player, "The current Intensity boost is ".. Game.Info.BoostedIntensity ..". Boosting by another 0.5 will cost ".. boostCost .." Gems.", "Intensity Boost", true)
  22.     end
  23.  
  24.     if PlayerData.stats.gems >= boostCost then
  25.         Game.Info.BoostCount += 1
  26.         Game.Info.BoostedIntensity += 0.5
  27.         Game.BoostSum += 1
  28.        
  29.         Profile:updatePlayerData(
  30.             {"stats", "gems"},
  31.             "PlayerData",
  32.             "Increment",
  33.             -Game.Info.IntBoostCurrentCost or 0
  34.         )
  35.        
  36.         if not FE2Library.BoostCosts[Game.Info.BoostCount+1] then
  37.             updPanelInfo("BoostingEnabled", false)
  38.         else
  39.             updPanelInfo(
  40.                 "IntBoostCurrentCost", FE2Library.BoostCosts[Game.Info.BoostCount + 1]
  41.             )
  42.         end
  43.  
  44.         local minInt = math.clamp(Game.Info.Intensity+
  45.             Functions.GetIntensityChange(1,
  46.             Game.Info.Intensity, Game.Info.BoostedIntensity, 5.99), 1, 5.99
  47.         )
  48.        
  49.         Remotes.Alert:FireAllClients((Player.Name .. " boosted! Min. Intensity: %s - %s"):format(
  50.             minInt, Game.Info.Intensity + Functions.GetIntensityChange(0, Game.Info.Intensity, Game.Info.BoostedIntensity)),
  51.             FE2Library.DiffColors[math.floor(minInt)] or nil, nil, minInt >= 5.99 and 'rainbow' or nil
  52.         )
  53.  
  54.         Remotes.Sound:FireAllClients(1044088048, 5, 1 + (0.05 * Game.Info.BoostCount))
  55.         ProgressDailyChallenge(Player, 19)
  56.     else return Remotes.Alert:FireClient(Player, "Not enough currency!") end
  57. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement