For example, something like a module script that contains all the characters stats, where you can just type in the name, ability names, ability cooldowns, run speed, health and other stats, create a folder with their name, throw their rig in there, and they just appear, like the buttons are already there, they have all of their stats, and you just have to script the individual abilities as modules, with a function like module.UseAbility() or something, and throw it in the same folder as the character, probably under another folder for abilities, and they just work. Reduces alot of the scripting needed, which would help you pump out updates faster, and more reliably, which helps gain more players.
Im not the best at explanations, so i think it would be better if i just showed an example.
Server Code:
function rusher.New(number, generatedRooms, entityName, bypass)
local avLocker = rusher.LockerCheck(number, generatedRooms)
if not bypass then
if avLocker == false then spawnError:Fire() return end
end
local dataCurrentEntity = entityData[entityName]
local entityData = require(script.Parent.EntityData)
local entityAbility = nil
if dataCurrentEntity.SpawnAbility or dataCurrentEntity.NearAbility then
entityAbility = require(entityAssets.RusherEntityAbilties[entityName])
end
if not entityAssets.Entities:FindFirstChild(entityName) then return warn(entityName, "is not a valid entity.") end
local currentEntity = entityAssets.Entities[entityName]:Clone()
local spawnRoomN = number-dataCurrentEntity.SpawnRoom
local endRoomN = number+dataCurrentEntity.EndRoom
local ignoreList = {}
if not generatedRooms[spawnRoomN] then spawnRoomN = 1 end
if not generatedRooms[endRoomN] then endRoomN = #generatedRooms end
local spawnRoom = generatedRooms[spawnRoomN]
local endRoom = generatedRooms[endRoomN]
local totalRebounds = dataCurrentEntity.Rebounds
if not totalRebounds then totalRebounds = 1 end
local entityDelay = dataCurrentEntity.Delay
if not entityDelay then entityData = 0 end
if dataCurrentEntity.Backwards then
currentEntity:PivotTo(endRoom.Exit.CFrame)
else
currentEntity:PivotTo(spawnRoom.Entrance.CFrame)
end
currentEntity.Parent = workspace.CurrentEntities
if dataCurrentEntity.SpawnAbility then
entityAbility.SpawnAbility(currentEntity)
end
local navigatedEnd = Instance.new("BindableEvent")
rusher.Nav(currentEntity, spawnRoomN, endRoomN, generatedRooms, dataCurrentEntity.Speed, dataCurrentEntity.Damage, dataCurrentEntity.Raycast, dataCurrentEntity.Backwards, dataCurrentEntity.AudioSlowdown, dataCurrentEntity.MinRebounds, dataCurrentEntity.MaxRebounds, entityDelay, navigatedEnd, ignoreList)
end
Module script:
local entityInfo = {
["A-60"] = {
["Type"] = "Rusher",
["SpawnRoom"] = 6,
["EndRoom"] = 9,
["Speed"] = 250,
["Damage"] = 150,
["Raycast"] = true,
["AudioSlowdown"] = true,
["Delay"] = 7,
["Weight"] = 1,
["MinRoom"] = 15,
},
["A-95"] = {
["Type"] = "Rusher",
["SpawnRoom"] = 6,
["EndRoom"] = 4,
["Speed"] = 55,
["Damage"] = 300,
["Raycast"] = true,
["Backwards"] = true,
["Delay"] = 7,
["Weight"] = 0.25,
["MinRoom"] = 33,
["SpawnAbility"] = true,
},
["A-120"] = {
["Type"] = "Rusher",
["SpawnRoom"] = 4,
["EndRoom"] = 3,
["Speed"] = 85,
["Damage"] = 400,
["Raycast"] = false,
["Backwards"] = true,
["MinRebounds"] = 2,
["MaxRebounds"] = 3,
["Delay"] = 5.5,
["Weight"] = 0.45,
["MinRoom"] = 28,
},
["A-140"] = {
["Type"] = "Rusher",
["SpawnRoom"] = 5,
["EndRoom"] = 0,
["Speed"] = 65,
["Damage"] = 1200,
["Raycast"] = false,
["Backwards"] = false,
["Delay"] = 8,
["Weight"] = 0.15,
["MinRoom"] = 35,
},
This is a script used in my game, inspired by doors. This code handles all the “rusher” category monsters, which rush through every room. As you can see, i dont have to individually script all of them, instead, i simply throw their model in a folder, write all their stats, and it works. The ones with a “spawn ability” value, have special modules scripts in another folder, allowing me to easily script a new monster without tons of effort.