Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Remotes.BoostIntensity.OnServerEvent:Connect(function(Player : Player, Agreed : Boolean, PassKey : Number)
- if not Game.Info.BoostingEnabled then
- return Remotes.Alert:FireClient(Player, "Boosting is disabled")
- end
- if not FE2Library.BoostCosts[Game.Info.BoostCount+1] then
- return Remotes.Alert:FireClient(Player, "Max number of boosts reached!")
- end
- if Game.Info.Intensity + Functions.GetIntensityChange(0, Game.Info.Difficulty, Game.Info.BoostedIntensity) >= 5.99 then
- return Remotes.Alert:FireClient(Player, "Max intensity has already been guaranteed!")
- end
- local Profile = DataModule.getProfile(Player)
- local PlayerData = Profile.playerData
- local OwnsGamePass = table.find(Profile.ownedGamepasses, 14784835)
- local TwoX = OwnsGamePass and 1 or 0.5
- local boostCost = FE2Library.BoostCosts[Game.Info.BoostCount+1]
- if (not Agreed) and Game.Info.BoostCount > 1 then
- 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)
- end
- if PlayerData.stats.gems >= boostCost then
- Game.Info.BoostCount += 1
- Game.Info.BoostedIntensity += 0.5
- Game.BoostSum += 1
- Profile:updatePlayerData(
- {"stats", "gems"},
- "PlayerData",
- "Increment",
- -Game.Info.IntBoostCurrentCost or 0
- )
- if not FE2Library.BoostCosts[Game.Info.BoostCount+1] then
- updPanelInfo("BoostingEnabled", false)
- else
- updPanelInfo(
- "IntBoostCurrentCost", FE2Library.BoostCosts[Game.Info.BoostCount + 1]
- )
- end
- local minInt = math.clamp(Game.Info.Intensity+
- Functions.GetIntensityChange(1,
- Game.Info.Intensity, Game.Info.BoostedIntensity, 5.99), 1, 5.99
- )
- Remotes.Alert:FireAllClients((Player.Name .. " boosted! Min. Intensity: %s - %s"):format(
- minInt, Game.Info.Intensity + Functions.GetIntensityChange(0, Game.Info.Intensity, Game.Info.BoostedIntensity)),
- FE2Library.DiffColors[math.floor(minInt)] or nil, nil, minInt >= 5.99 and 'rainbow' or nil
- )
- Remotes.Sound:FireAllClients(1044088048, 5, 1 + (0.05 * Game.Info.BoostCount))
- ProgressDailyChallenge(Player, 19)
- else return Remotes.Alert:FireClient(Player, "Not enough currency!") end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement