Skip to content

Instantly share code, notes, and snippets.

View naturecodevoid's full-sized avatar
💭
I may be slow to respond.

naturecodevoid

💭
I may be slow to respond.
View GitHub Profile
/* A little utility to execute strings as template literals */
// https://gist.github.com/naturecodevoid/d99f217942860dedd25538e7f108f996
const executeTemplateLiteral = (string, args, argNames, replace$ = true) => {
let temporary = `${string}`;
if (replace$) temporary = temporary.replaceAll("{", "${");
return new Function(...argNames, `return \`${temporary}\`;`)(...args);
};
@naturecodevoid
naturecodevoid / ctjs-faq.md
Last active September 8, 2020 18:38
ct.js FAQ

ct.js FAQ

The camera won't follow my charater!

Make sure you have this code in your character's 'On Create' tab:

ct.camera.follow = this;

// Optional; sets the frame inside which the copy will be kept, in game pixels. Can be set to `null` so the copy is set to the center of the screen.
git rm -r --cached .
git add .
find . -name .DS_Store -print -delete
const library = {};
{
if (typeof define === "function" && define.amd) {
// AMD
define([], function () {
return library;
});
}
if (typeof module === "object" && module.exports) {
@naturecodevoid
naturecodevoid / CooldownButton.cs
Last active May 11, 2021 14:36 — forked from gabriel-nsiqueira/CooldownButton.cs
CooldownButton for Among Us mods (with example)
/*
HOW TO USE: (reactor is recommended)
1. Copy the code in this file (not including this comment) to CooldownButton.cs
2. Get an image for your button (150 x 150 pixels is recommended) and add it to the VS solution. Make sure the 'Build Action' of the image in VS is 'Embedded resource'
3. Make a button patch. This one will make a button in the bottom left of the screen that prints 'PRESS' on press, everyone can press it and has a cooldown of 5 seconds.
```
[HarmonyPatch(typeof(HudManager), nameof(HudManager.Start))]
public static class ExampleButton
{
private static CooldownButton btn;
@naturecodevoid
naturecodevoid / AmongUsModdingResources.md
Last active January 10, 2021 16:46
A list of resources for among us modding. Aimed at helping beginners

Among Us Modding Resources

A list of resources for among us modding.

Getting started: go to https://docs.reactor.gg/docs

or: go to the website reactor.gg, join the discord and see the pinned message in #modding

  • General
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file has been truncated, but you can view the full file.
[
{
"name": "GlobalConstants",
"base_class": "",
"api_type": "core",
"singleton": true,
"singleton_name": "GlobalConstants",
"instanciable": false,
"is_reference": false,
"constants": {