PoppingPopper
PoppingPopper
Explore posts from servers
Rroblox-ts
Created by PoppingPopper on 5/25/2025 in #help
Why is my model only rotating it's primary part?
No description
33 replies
Rroblox-ts
Created by PoppingPopper on 1/24/2025 in #help
Weird jittering when moving model over terrain
No description
11 replies
Rroblox-ts
Created by PoppingPopper on 11/3/2024 in #help
Source and destination must not be the same
❯ npm run watch

> rbxtsc -w

[3:26:39 PM] Starting compilation in watch mode...

/Users/myusername/Desktop/roblox-test/node_modules/roblox-ts/out/Project/functions/setupProjectWatchProgram.js:172
throw e;
^

Error: Source and destination must not be the same.
at Object.checkPathsSync (/Users/myusername/Desktop/roblox-test/node_modules/roblox-ts/node_modules/fs-extra/lib/util/stat.js:75:13)
at Object.copySync (/Users/myusername/Desktop/roblox-test/node_modules/roblox-ts/node_modules/fs-extra/lib/copy/copy-sync.js:27:38)
at copyItem (/Users/myusername/Desktop/roblox-test/node_modules/roblox-ts/out/Project/functions/copyItem.js:11:24)
at /Users/myusername/Desktop/roblox-test/node_modules/roblox-ts/out/Project/functions/copyFiles.js:9:37
at benchmarkIfVerbose (/Users/myusername/Desktop/roblox-test/node_modules/roblox-ts/out/Shared/util/benchmark.js:24:9)
at copyFiles (/Users/myusername/Desktop/roblox-test/node_modules/roblox-ts/out/Project/functions/copyFiles.js:7:40)
at runInitialCompile (/Users/myusername/Desktop/roblox-test/node_modules/roblox-ts/out/Project/functions/setupProjectWatchProgram.js:77:35)
at runCompile (/Users/myusername/Desktop/roblox-test/node_modules/roblox-ts/out/Project/functions/setupProjectWatchProgram.js:152:24)
at FSWatcher.<anonymous> (/Users/myusername/Desktop/roblox-test/node_modules/roblox-ts/out/Project/functions/setupProjectWatchProgram.js:209:26)
at Object.onceWrapper (node:events:621:28)

Node.js v23.0.0
❯ npm run watch

> rbxtsc -w

[3:26:39 PM] Starting compilation in watch mode...

/Users/myusername/Desktop/roblox-test/node_modules/roblox-ts/out/Project/functions/setupProjectWatchProgram.js:172
throw e;
^

Error: Source and destination must not be the same.
at Object.checkPathsSync (/Users/myusername/Desktop/roblox-test/node_modules/roblox-ts/node_modules/fs-extra/lib/util/stat.js:75:13)
at Object.copySync (/Users/myusername/Desktop/roblox-test/node_modules/roblox-ts/node_modules/fs-extra/lib/copy/copy-sync.js:27:38)
at copyItem (/Users/myusername/Desktop/roblox-test/node_modules/roblox-ts/out/Project/functions/copyItem.js:11:24)
at /Users/myusername/Desktop/roblox-test/node_modules/roblox-ts/out/Project/functions/copyFiles.js:9:37
at benchmarkIfVerbose (/Users/myusername/Desktop/roblox-test/node_modules/roblox-ts/out/Shared/util/benchmark.js:24:9)
at copyFiles (/Users/myusername/Desktop/roblox-test/node_modules/roblox-ts/out/Project/functions/copyFiles.js:7:40)
at runInitialCompile (/Users/myusername/Desktop/roblox-test/node_modules/roblox-ts/out/Project/functions/setupProjectWatchProgram.js:77:35)
at runCompile (/Users/myusername/Desktop/roblox-test/node_modules/roblox-ts/out/Project/functions/setupProjectWatchProgram.js:152:24)
at FSWatcher.<anonymous> (/Users/myusername/Desktop/roblox-test/node_modules/roblox-ts/out/Project/functions/setupProjectWatchProgram.js:209:26)
at Object.onceWrapper (node:events:621:28)

Node.js v23.0.0
33 replies
DDeno
Created by PoppingPopper on 10/10/2024 in #help
Why is deno asking me for permission if I have provided the allow all flag?
3 replies
Rroblox-ts
Created by PoppingPopper on 11/10/2023 in #help
Is map.values() not available in roblox-ts?
No description
6 replies
Rroblox-ts
Created by PoppingPopper on 3/6/2023 in #help
Conditional Return Type
I have a question. Let's say, I want to create a function that takes in 1 optional parameter arg of type T. The function also returns the value of the optional parameter.
function foo<T>(arg?: T) {
return arg
}
function foo<T>(arg?: T) {
return arg
}
In this scenario, is it possible for me to affect the return type to where it would return the value as T or as T | undefined based on whether or not arg is provided?
const test1 = foo<string>() //typeof test1 === string | undefined
const test2 = foo('string') //typeof test2 === string
const test1 = foo<string>() //typeof test1 === string | undefined
const test2 = foo('string') //typeof test2 === string
LOL forgot about function overloading... Nevermind.
1 replies
Rroblox-ts
Created by PoppingPopper on 2/26/2023 in #help
What is this error? How can I resolve it?
No description
8 replies
Rroblox-ts
Created by PoppingPopper on 2/21/2023 in #help
Abstract Class
Getting an error saying
src/server/components/Holdable.ts:26:21 - error TS2345: Argument of type 'typeof Holdable' is not assignable to parameter of type 'Constructor<object>'.
Cannot assign an abstract constructor type to a non-abstract constructor type.
src/server/components/Holdable.ts:26:21 - error TS2345: Argument of type 'typeof Holdable' is not assignable to parameter of type 'Constructor<object>'.
Cannot assign an abstract constructor type to a non-abstract constructor type.
I'm new to abstraction so I'm not sure if the way I've set it up is causing this problem but I'm having trouble debugging. Looking for someone to help me understand this error and how I might fix it.
import { OnStart } from "@flamework/core";
import { Component, BaseComponent } from "@flamework/components";

interface Attributes {}

export interface HoldableInstance extends Model {
PrimaryPart: (Part | BasePart) & {
PromptAttachment: Attachment & {
ProximityPrompt: ProximityPrompt;
}
}
}

@Component()
/**
* Abstract class for holdable items
*/
export abstract class Holdable extends BaseComponent<Attributes, HoldableInstance> implements OnStart {
abstract debugTag: string

onStart() {
print(this.debugTag);
}
}
import { OnStart } from "@flamework/core";
import { Component, BaseComponent } from "@flamework/components";

interface Attributes {}

export interface HoldableInstance extends Model {
PrimaryPart: (Part | BasePart) & {
PromptAttachment: Attachment & {
ProximityPrompt: ProximityPrompt;
}
}
}

@Component()
/**
* Abstract class for holdable items
*/
export abstract class Holdable extends BaseComponent<Attributes, HoldableInstance> implements OnStart {
abstract debugTag: string

onStart() {
print(this.debugTag);
}
}
7 replies
Rroblox-ts
Created by PoppingPopper on 2/17/2023 in #help
this.destroy() unexpected behavior?
It says "Destroys this component instance." but after calling it I don't see that it was destroyed.
open() {
this.minInteractions = 0;

const egg = this.instance;
const top = egg.Top;
const bottom = egg.Bottom;

top.Base.WeldConstraint.Destroy();
top.Parent = game.Workspace;
bottom.Base.WeldConstraint.Destroy();
bottom.Parent = game.Workspace;

this.destroy();
}
open() {
this.minInteractions = 0;

const egg = this.instance;
const top = egg.Top;
const bottom = egg.Bottom;

top.Base.WeldConstraint.Destroy();
top.Parent = game.Workspace;
bottom.Base.WeldConstraint.Destroy();
bottom.Parent = game.Workspace;

this.destroy();
}
6 replies
Rroblox-ts
Created by PoppingPopper on 2/16/2023 in #help
Proximity Prompt doesn't show up when inside MaxActivationDistance
No description
4 replies
Rroblox-ts
Created by PoppingPopper on 2/13/2023 in #help
Humanoid is not loaded when Character is loaded?
@Controller()
export class PlayerAnimation implements OnStart {
onStart() {
print("Start");
const localPlayer = Players.LocalPlayer;
const animation = createPreviewAnimation(carryKeyframeSequence);

if (!animation) {
warn("Animation was not created");
return;
}

const character = localPlayer.Character || localPlayer.CharacterAdded.Wait()[0];
const humanoid = character.FindFirstChildOfClass("Humanoid");
if (!humanoid) {
warn("Humanoid was not found");
return;
}
//...
}
}
@Controller()
export class PlayerAnimation implements OnStart {
onStart() {
print("Start");
const localPlayer = Players.LocalPlayer;
const animation = createPreviewAnimation(carryKeyframeSequence);

if (!animation) {
warn("Animation was not created");
return;
}

const character = localPlayer.Character || localPlayer.CharacterAdded.Wait()[0];
const humanoid = character.FindFirstChildOfClass("Humanoid");
if (!humanoid) {
warn("Humanoid was not found");
return;
}
//...
}
}
4 replies
Rroblox-ts
Created by PoppingPopper on 12/23/2022 in #help
When is it appropriate to retrieve a component from an instance in Flamework?
I'm attempting to grab one in the onStart of one of my services and it can't find it? (Have tag all set up)
2 replies
Rroblox-ts
Created by PoppingPopper on 12/22/2022 in #help
How do I type my component?
For instance if I have a model component, how can I type it so that I know it's children?
13 replies
Rroblox-ts
Created by PoppingPopper on 12/21/2022 in #help
Unexpected behavior, adding Vector3 to CFrame
No description
32 replies
Rroblox-ts
Created by PoppingPopper on 12/20/2022 in #help
Debounce not working?
No description
3 replies
Rroblox-ts
Created by PoppingPopper on 12/6/2022 in #help
Why does this pathing occur?
All obstructions cannot collide with the npc other than the terrain.
5 replies
RReactiflux
Created by PoppingPopper on 10/8/2022 in #react-forum
setInterval without destroying it to update state?
I have a perdicament where I want to update state on an interval. Every way that I go about it I find myself being forced to use the dependency array of the useEffect for the setInterval so I can get updated state values. This causes my interval to just be destroyed and rebuilt every interval because of state changing on the interval. How can I achieve this interval without ever having to destroy it to listen to state changes?
const [incrementCount, setIncrementCount] = useState(1);
const [translationX, setTranslationX] = useState([...INIT_TRANSLATION_X]);

const incrementTranslationX = useCallback(() => {
if (incrementCount && incrementCount % 2 === 0) { //* the condition
setIncrementCount(0);
setTranslationX([...INIT_TRANSLATION_X]);
} else {
setIncrementCount((prev) => prev + 1);
setTranslationX((prev) => [prev[0] + INCREMENT, prev[1] + INCREMENT]);
}
}, [incrementCount, translationX]);

//loop interval
useEffect(() => {
const interval = setInterval(() => {
incrementTranslationX();
}, INTERVAL);

return () => {
clearInterval(interval);
console.log("DESTROYED INTERVAL");
};
}, [incrementTranslationX]); //! cannot update (the condition) without this
const [incrementCount, setIncrementCount] = useState(1);
const [translationX, setTranslationX] = useState([...INIT_TRANSLATION_X]);

const incrementTranslationX = useCallback(() => {
if (incrementCount && incrementCount % 2 === 0) { //* the condition
setIncrementCount(0);
setTranslationX([...INIT_TRANSLATION_X]);
} else {
setIncrementCount((prev) => prev + 1);
setTranslationX((prev) => [prev[0] + INCREMENT, prev[1] + INCREMENT]);
}
}, [incrementCount, translationX]);

//loop interval
useEffect(() => {
const interval = setInterval(() => {
incrementTranslationX();
}, INTERVAL);

return () => {
clearInterval(interval);
console.log("DESTROYED INTERVAL");
};
}, [incrementTranslationX]); //! cannot update (the condition) without this
5 replies
Rroblox-ts
Created by PoppingPopper on 10/2/2022 in #help
Dynamic index signature parameter type
How can I create a dynamic index signature parameter type that doesn't require all of the keys from the mapped type?
enum Color {
cyan = 'cyan',
white = 'white',
gray = 'gray',
}

type Variants = {
[style: string]: {[key in Color]: string}
}

const foo: Variants = {
solid: {
gray: '...'
}
}
//error: Type '{ gray: string; }' is missing the following properties from type '{ cyan: string; white: string; gray: string; }': cyan, white
enum Color {
cyan = 'cyan',
white = 'white',
gray = 'gray',
}

type Variants = {
[style: string]: {[key in Color]: string}
}

const foo: Variants = {
solid: {
gray: '...'
}
}
//error: Type '{ gray: string; }' is missing the following properties from type '{ cyan: string; white: string; gray: string; }': cyan, white
2 replies
Rroblox-ts
Created by PoppingPopper on 8/27/2022 in #help
Eslint Prettier problem
No description
3 replies
Rroblox-ts
Created by PoppingPopper on 8/23/2022 in #help
Unexpected Behavior
I am trying to assign players to slots in my state, this is what my state looks like
//this.lanes
{
team1: {
slot1: {
stat1: number
stat2: number
player?: Player
},
slot2: {
etc...
}
etc...
}
team2: {
etc...
}
}
//this.lanes
{
team1: {
slot1: {
stat1: number
stat2: number
player?: Player
},
slot2: {
etc...
}
etc...
}
team2: {
etc...
}
}
When I iterate over the players (in my test case only 1), the same player is assigned to EVERY slot.
setupPlayers() {
const players = shuffle(PlayerService.GetPlayers())
players.forEach((player, index) => {
this.assignPlayerToTeam(player, index)
})
}
setupPlayers() {
const players = shuffle(PlayerService.GetPlayers())
players.forEach((player, index) => {
this.assignPlayerToTeam(player, index)
})
}
assignPlayerToTeam(player: Player, index: number) {
let side: keyof typeof this.lanes = "team1"
if (index <= 3) side = 'team2'
if (index === 0) this.lanes[side].slot1.player = player
else if (index === 1) this.lanes[side].slot2.player = player
else if (index === 2) this.lanes[side].slot3.player = player
else if (index === 3) this.lanes[side].slot4.player = player
}
assignPlayerToTeam(player: Player, index: number) {
let side: keyof typeof this.lanes = "team1"
if (index <= 3) side = 'team2'
if (index === 0) this.lanes[side].slot1.player = player
else if (index === 1) this.lanes[side].slot2.player = player
else if (index === 2) this.lanes[side].slot3.player = player
else if (index === 3) this.lanes[side].slot4.player = player
}
15 replies