Luau scripts for Roblox games: game systems, mechanics and utility code, written to be read and reused.
4.5 out of 515 assets
Mega Dodgeball
6 assetsAdvanced Lua scripting implementation including physics-based ball mechanics, real-time multiplayer synchronization, player progression systems, and comprehensive game state management.
A preview of the settings menu, with toggles and draggable sliders for volume and other settings
VideoMap Picking System
0:00 / 0:00
A preview of the map picking system, with a map list and dynamic avatar display showing the players who voted for each map
VideoEquipment and Customization System
0:00 / 0:00
A video demonstrating the equipment and customization system, with a list of equippable items and the showcase of applied customization by equipping the items
VideoKill & Round Showcase
0:00 / 0:00
A showcase of the kill and round system, showing what happens when a player kills another player and how the final kill triggers the round end
Ball Physics System
local ball = script.Parent -- Ball objectlocal runService = game:GetService("RunService")-- RunService for time trackinglocalfunctionplayBounceSound(ballVelocity)local speed = ballVelocity.magnitude -- Get the speed of the ball-- volume and playback rate based on speedlocal volume = math.clamp(speed /40,0,1)local playbackRate = math.clamp(speed /50,0.85,1.15)
ball.BallBounce:Play()
ball.BallBounce.Volume = volume
ball.BallBounce.PlaybackSpeed = playbackRate
local currentTime = runService.Stepped:Wait()-- Get the current time
lastSoundTime = currentTime -- Update the last sound timeend
5 assetsI developed the core RNG system with exponential luck modifiers, comprehensive inventory and equipment systems, player stats management, and data persistence. This was my first major scripting project where I learned Lua programming through tutorials and practical implementation.
return{
getRandomIndex =function(chances, luckModifier)print(luckModifier)local totalWeight =0local weightedItems ={}-- Calculate weights with an exponential impact of the luck modifierfor _, item inipairs(chances)do-- Instead of dividing directly, use an exponential adjustmentlocal adjustedChance = item.chance ^(1/ luckModifier)local weight =1/ adjustedChance -- Inverse of the adjusted chance
table.insert(weightedItems,{item = item, weight = weight})
totalWeight = totalWeight + weight
end-- Generate a random number within the total weightlocal randomWeight = math.random()* totalWeight
-- Select the item based on the random weightlocal cumulativeWeight =0for _, weightedItem inipairs(weightedItems)do
cumulativeWeight = cumulativeWeight + weightedItem.weight
if randomWeight <= cumulativeWeight thenlocal item = weightedItem.item
return{name = item.name, chance = item.chance, color = item.color, image = item.image, flavour = item.flavour}endendend}
Weapon Chances System
local Weapons = game.ReplicatedStorage:WaitForChild("Weapons")localfunctionisValidated(weapon)local requiredChildren ={
Chance ="IntValue",
Equipped ="BoolValue",
ImageID ="StringValue",
WeaponColor ="Color3Value",
WeaponDamage ="IntValue",
WeaponFlavourName ="StringValue"}for childName, childType inpairs(requiredChildren)dolocal child = weapon:FindFirstChild(childName)ifnot child ornot child:IsA(childType)then-- If the child is missing or not the correct type, return falsereturnfalseendendreturntrueendlocal weaponChances ={}for _, weapon inpairs(Weapons:GetChildren())doifisValidated(weapon)then
table.insert(weaponChances,{
name = weapon.Name,
chance = weapon.Chance.Value,
color = weapon.WeaponColor.Value,
image = weapon.ImageID.Value,
flavour = weapon.WeaponFlavourName.Value
})endend
table.sort(weaponChances,function(a, b)return a.chance < b.chance
end)return weaponChances
A video showcasing the luck weighting system, where the Player's Luck stat influences the chance of rolling higher rarity weapons, keeping balanced outcomes between lower and higher rarities
VideoAll systems showcase
0:00 / 0:00
A video showcasing all the systems in the game, including the RNG system, inventory system, equipment system, stats system, and rolling system
More
4 assets
UGC Prompt System + Data
1 asset
A system which allows players to earn coins passively and claim UGC items when enough
VideoUGC Prompter
0:00 / 0:00
UGC Prompter
Weighted Wheel of Fate
1 asset
A weighted wheel inspired from "Wheel of Fait"
VideoWeighted Wheel of Fate
0:00 / 0:00
The sections of the wheel are weighted and change size based on the weight dynamically. It's not just a static image.
I'd like to use Google Analytics to see which pages people read. It only loads if you allow it, and you can change your mind any time from Cookie settings at the bottom of the page. Privacy policy