Why Boost?
-
Versatile
By allowing developers to write custom logic for applying boosts, Boost supports nearly any type of boost you could imagine, whether it’s additive or multiplicative. -
Scalable
Boost remains performant regardless of the scope of your project or the size of your servers. Its modular architecture ensures seamless addition of new boosts as your game evolves. -
Reliable
Boost’s reliability is demonstrated through its flawless performance in Math Color Race. It has proven its ability to maintain consistent performance under any condition, ensuring effective management of player boosts without introducing bugs or performance issues.
Example usage
Implementing Boost is straightforward:
local Players = game:GetService("Players")
local Boost = require(path.to.boost)
Players.PlayerAdded:Connect(function(player)
-- Create win multiplier value
local winMultiplier = Instance.new("NumberValue")
winMultiplier.Name = "WinMultiplier"
winMultiplier.Value = 1
winMultiplier.Parent = player
-- Create win multiplier boost for player
local winMultiplierBoost = Boost.new(player, "Wins", function(boosts)
-- This function is called whenever the boost is updated
local total = 1
for _, boost in pairs(boosts) do
total *= boost
end
winMultiplier.Value = boost
end)
-- Add 2x wins boost
winMultiplierBoost:add("2xWins", 2)
end)
Players.PlayerRemoving:Connect(function(player)
-- Destroy win multiplier boost
Boost.get(player, "Wins"):destroy()
end)
When awarding wins to a player, simply multiply the amount by player.WinMultiplier.Value
.
This is my first community resource, so please be kind . Feedback is appreciated.