roblox-ts

R

roblox-ts

Join the community to ask questions about roblox-ts and get answers from other members.

Join

404 Can’t publish my package

I am trying to publish a package to @rbxts, but it says "<name>' is not in this registry.", I am apart of the org, I am signed into npm cli. What am I missing? https://github.com/MarcL01/RewindCSS - Ported RowindCSS to React "RewindCSS" My npm username is bigmarco254...
Solution:
SOLUTION: You have to submit your username to https://roblox-ts.com/join-org/success/ twice, once to get an invite email to join, after joining resubmit your username to https://roblox-ts.com/join-org/success/ and it "finalizes" it i guess

Jecs replication

Just trying to make my own replication system. Is there a better approach? ```ts function blah(world: World): void { Players.PlayerAdded.Connect((player: Player) => {...

Infinite yield possible on 'ServerScriptService.TS:WaitForChild("network")'

This is an issue with the RuntimeLib script that roblox-ts uses ```luau Infinite yield possible on 'ServerScriptService.TS:WaitForChild("network")' Stack Begin...
Solution:
can you recompile?

How can I get the value of a type on runtime?

i tried using @Tesmi 's reflection library but the transformer doesn't seem to work with unions, are there any other methods?
Solution:
solved ```typescript /** @metadata macro */ export function getTypeValue<T>(meta?: Modding.Many<T extends Array<string> ? T : never>) { return meta;...
No description

Updating React broke @rbxts/pretty-react-hooks and many other modules

Here is my package.json I am getting an error in the console of: ``` 13:24:41.102 Infinite yield possible on 'ReplicatedStorage.rbxts_include.node_modules.@rbxts.pretty-react-hooks.node_modules.@rbxts:WaitForChild("ReactLua")' - Studio...
Solution:
deleting out, node_modules, flamework.build as well as yarn upgrade fixed it for me. I guess sometimes you really gotta wipe it all out 🤣

flamework Could not resolve component 'qB' while constructing 'Al' fix?

only happens some of the times and im just curious what could be the reason

Flamecs compatibility

Which versions of Flamecs work with the latest version of Jecs? I’ve been using trial and error for quite a while now to get them to work together. The latest version of Jecs gives me an error when I try to create a new world, and Flamecs gives me an error with the second-latest version of Jecs that says: “attempt to index nil with 'new'.” I've made this barebones so I only have Flamecs, Jecs, and the Flamework template....
Solution:
Got latest flamecs to work with 0.5.5

First React Code Review

so this is my first time using react roblox and I'm not sure if i did any bad practices in this code, it's working without lag but obs lags my laptop, also sorry PepeElToro I'm only using this background right now as a placeholder until i make/find a grid, also this is not a storybook plugin
Solution:
useEffect needs an array of dependencies

importing instance for jest mock

I wanted to do something like ```ts jest.mock<typeof import("common/client/constants/local-player")>( import("common/client/constants/local-player").await(), () => {...

Inhereting attributes are nil

Hello, I was trying to inhereted some attributes because of repeating code, but for some unknown reason they are "nil" no matter what I do ```ts interface IAttributes extends ControlInterfaceAttributes { acceleration: number; maxSpeed: number;...
No description

Retain instances in Viewport Frame with React

I would like to parent an instance to a viewport frame and ensure that it does not get destroyed when the parent element (a react viewport frame component) repaints. I am not very familiar with how repainting works or if it is even possible for the object to be destroyed unless the parent element is unmounted. What could I do to ensure the object does not get destroyed unless the parent viewport frame unmounts? Just use clones I can not use clones, it's an instance referenced by the server and I would like any attribute changes to be mirrored to the client. Although I know I can just clone the instance anyways and watch for attribute changes on the original instance, the purpose of this post is to ask whether there is any way to achieve the goal and parent the original instance to the viewport frame component. ...

How do you make a viewmodel arms system?

I want to create a system for first-person viewmodel arms. I want to keep it organized with components and controllers, but I don't know how. Should the arms be part of the object that I'm holding or can they be separate? Should the arms be a component? Any examples or advice on how to build this properly with Flamework would be great.
Solution:
I'd make a controller that controls arms enables and disables, without components. You could add what type of hands to do, animation set to use and prob what weapon to hold...

I can't access currect class properities

hello I have 2 classes which look like this: ```ts export abstract class ControlInterface< A extends {} = {},...

Charm Questions

I'm not sure if this has been discussed before but I have three questions about charm: 1. What happens if you want to assign nil (undefined) to an atom? Do you have to attach a function that returns nil (or undefined)? 2. What if an atom stores a function? Do you need to chain a function inside a function? 3. What happens if your effect callback uses a dependency conditionally? How will charm know about that dependency if the dependency does not get read from/written to the first time the callback is executed? Thank you in advance for the help!...
Solution:
1. you can write myAtom(nil), which has different behavior from myAtom() 2. charm will assume when you pass a function to an atom, its an updater function -- avoid setting atoms to functions, wrap it in a table if you must 3. charm unsubs from dependencies that didn't get called during the latest effect run...
Message Not Public
Sign In & Join Server To View

is there any way of finding multiple inhereted classes?

as you can see on the image, I have class endpoint, which I am inhereting into finding inhereted classes(there can be X count of them) and then finding inhereted of them again
No description

error TS roblox-ts: compilerOptions.jsxFactory must be `Roact.createElement`

Compiler saying I need to use "Roact.createElement" in "compilerOptions.jsxFactory" when using React I'm using flamework and react ``ts // Error message src/client/components/ui/plusOneEffect.tsx:13:13 - error TS roblox-ts: compilerOptions.jsxFactory must be Roact.createElement`!...
Solution:
run npm i roblox-ts@latest

package is not importing correctly to another package

This package isn't importing correctly from @rbxts/planck-matter-hooks and gives this error
ReplicatedStorage.rbxts_include.node_modules.@rbxts.matter-hooks.out.package.Matter:4: attempt to index nil with 'import'
ReplicatedStorage.rbxts_include.node_modules.@rbxts.matter-hooks.out.package.Matter:4: attempt to index nil with 'import'
...
Solution:
for anyone that has the same bug, please check out commit hash 458f2fb for the repo up there (if it still exists)