Skip to content
This repository has been archived by the owner on Sep 13, 2022. It is now read-only.

Blaubeeree/au-moreroles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Update 2022-09-13

Archiving this project because Garry's Mod Among Us seems to be inactive and my addon is honestly very messy (I'll maybe rewrite it some day if I'm bored :D).

More Roles for Among Us

Steam Subscriptions Steam Favorites Steam Update Date

This addon makes it possible to add custom roles to Garry's Mod Among Us, inspired by TTT2.

This is still a beta version so expect bugs and let me know here if you find some.

Creating a Role

Your role should be located in

lua/amongus/roles/[rolename].lua          (shared)

or

                              init.lua    (serverside)
lua/amongus/roles/[rolename]/ cl_init.lua (clientside)
                              shared.lua  (shared)

Example shared file of a role with default values:

roles.CreateTeam(ROLE.name, {
  color = Color(0, 0, 0)
})

ROLE.name = nil -- defaults to filename
ROLE.color = Color(0, 0, 0)
ROLE.defaultTeam = TEAM_CREWMATE
ROLE.CanKill = false,
ROLE.CanSabotage = false,
ROLE.CanVent = false,
ROLE.HasTasks = true,
ROLE.ShowTeammates = false

ROLE.defaultCVarData = {
  pct = 1,
  max = 1,
  minPlayers = 1,
  random = 100
}

-- called after all roles are loaded
-- roles.SetBaseRole should be called here
function ROLE:Initialize() end

-- called when hud buttons are created
-- can be used to add custom buttons
hook.Add("GMAU ModifyButtons", "example", function(hud) end)

hook.Add("GMAU ShouldWin", "example", function(team)
  return true   -- team wins
  return false  -- prevent team from winning
  return nil    -- do nothing
end)

-- used to modify which roles will be given to the players
-- table selectableRoles has roleIDs as keys and the amount of players who should get the role as value
hook.Add("GMAU ModifySelectableRoles", "example", function(selectableRoles) end)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages