Coder Social home page Coder Social logo

au-moreroles's Introduction

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)

au-moreroles's People

Contributors

blaubeeree avatar

Stargazers

Neeve avatar

Watchers

 avatar

Forkers

clippyb

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.