Needing help with a mod code (Among Us)

So I am making a mod for Among Us, but I have my role code, but I need help with some of it. I am a complete beginner with C#, and I need some understanding and what to do next in the code. If anyone is willing to help me, just ping me, and I'll respond when I have time -# *(I can also share the file if needed)
3 Replies
Keswiik
Keswiik3mo ago
You will get much better results if you clearly state the issues you are having and post code. Nobody wants to spend time attempting to coax information out of you. $code
MODiX
MODiX3mo ago
To post C# code type the following: ```cs // code here ``` Get an example by typing $codegif in chat For longer snippets, use: https://paste.mod.gg/
『 AndriesWorks 』
this is the code, i need help wih setting up the rest of the options, which i am a complete beginner to, and dont understand anything, or even how to set it up
using TOHE.Roles.Core;
using static TOHE.Options;

namespace TOHE.Roles.Crewmate;

internal class Contractor : RoleBase
{
//===========================SETUP================================\\
private const int Id = 31800;
public static bool HasEnabled => CustomRoleManager.HasEnabled(CustomRoles.Contractor);
public override CustomRoles ThisRoleBase => CustomRoles.Shapeshifter;
public override Custom_RoleType ThisRoleType => Custom_RoleType.CrewmatePlanned;
//==================================================================\\

private static OptionItem TimeLimitForTask;
private static OptionItem MaxContracts;
private static OptionItem CanGiveNeutralsContracts;

public override void SetupCustomOption()
{
SetupRoleOptions(Id, TabGroup.CrewmateRoles, CustomRoles.Contractor);
MaxContracts = IntegerOptionItem.Create(Id + 5, "ContractorMaxContracts", new(1, 14, 1), 3, TabGroup.CrewmateRoles, false)
.SetParent(CustomRoleSpawnChances[CustomRoles.Contractor])
.SetValueFormat(OptionFormat.Times);
TimeLimitForTask = IntegerOptionItem.Create(Id + 10, "ContractorTimeLimitForTask", new(30, 180, 5), 45, TabGroup.CrewmateRoles, false)
.SetParent(CustomRoleSpawnChances[CustomRoles.Contractor])
.SetValueFormat(OptionFormat.Seconds);
CanGiveNeutralsContracts = BooleanOptionItem.Create(Id + 18, "ContractorCanGiveNeutralsContracts", false, TabGroup.CrewmateRoles, false)
.SetParent(CustomRoleSpawnChances[CustomRoles.Contractor]);
}
}
using TOHE.Roles.Core;
using static TOHE.Options;

namespace TOHE.Roles.Crewmate;

internal class Contractor : RoleBase
{
//===========================SETUP================================\\
private const int Id = 31800;
public static bool HasEnabled => CustomRoleManager.HasEnabled(CustomRoles.Contractor);
public override CustomRoles ThisRoleBase => CustomRoles.Shapeshifter;
public override Custom_RoleType ThisRoleType => Custom_RoleType.CrewmatePlanned;
//==================================================================\\

private static OptionItem TimeLimitForTask;
private static OptionItem MaxContracts;
private static OptionItem CanGiveNeutralsContracts;

public override void SetupCustomOption()
{
SetupRoleOptions(Id, TabGroup.CrewmateRoles, CustomRoles.Contractor);
MaxContracts = IntegerOptionItem.Create(Id + 5, "ContractorMaxContracts", new(1, 14, 1), 3, TabGroup.CrewmateRoles, false)
.SetParent(CustomRoleSpawnChances[CustomRoles.Contractor])
.SetValueFormat(OptionFormat.Times);
TimeLimitForTask = IntegerOptionItem.Create(Id + 10, "ContractorTimeLimitForTask", new(30, 180, 5), 45, TabGroup.CrewmateRoles, false)
.SetParent(CustomRoleSpawnChances[CustomRoles.Contractor])
.SetValueFormat(OptionFormat.Seconds);
CanGiveNeutralsContracts = BooleanOptionItem.Create(Id + 18, "ContractorCanGiveNeutralsContracts", false, TabGroup.CrewmateRoles, false)
.SetParent(CustomRoleSpawnChances[CustomRoles.Contractor]);
}
}

Did you find this page helpful?