I used --!strict
initially, but when I did it in VScode, it said no issues, but in Roblox I would get a bunch, so I removed the --!strict
for now
This is Odd. I am not sure why, for it doesn’t show up
I used --!strict
initially, but when I did it in VScode, it said no issues, but in Roblox I would get a bunch, so I removed the --!strict
for now
This is Odd. I am not sure why, for it doesn’t show up
Thats because VS Code doesnt natively support Luau. This lack of native support leads to inconsistencies and disagreements between VS Code’s standard Lua analysis and Roblox’s Luau implementation. It would best for you to annotate the code in roblox and make sure no type errors arise.
Edit: I have all of the roblox studio beta features enabled to adjust, just besides the new type solver.
Yeah, I switched from Vscode because it just gave me problems I only use it for the github repo. I removed strict from the scripts already and was able to fix the issues
I have the incremental typechecker and autocompletion on; maybe that’s the issue?
edit: I enabled the new luau type solver and it just gave me 500+ warnings
This may be, try changing it and maybe all of the type errors will be visible for you too
Edit: Thanks for helping me reach my goal:
I disabled and this is my script analysis now.
very odd
edit:
Try either running the game once or saving i.t Might fix?
Try removing the NetRay module and adding it again into the studio place youre in
I only get the extra warnings when I put --!strict
on the scripts I am guessing it’s showing you it all?
Literally i get warnings from almost all of the modules within the NetRay module and from the NetRay module itself. (ignore the highlighted type error, and the one on the bottom)
I think I know why now
Do you have this beta feature enabled? If so, turn it off.
without it on
I will be making all the scripts strict or most in the future
edit: the 3 warnings and expected and know, right now the JSON and EfficientTable types aren’t being used anyways since I changed the logic
Yeah please do! Its a must in my workspace. Thanks for helping me out!
No Problem, I’ll be focusing on the strict issues for the next update
I created a flowchart of the Dynamic Senders logic if you want to understand how it works.
I will update this in the future, as this is not everything but a simplified explanation
Is there a way to make this work with Tuples?
local _ray = require(game:WaitForChild("ReplicatedStorage", 500):WaitForChild("NetRay", 500))
_ray:GetEvent("_"):OnEvent(function(...)
print(...)
end)
local _ray = require(game:GetService("ReplicatedStorage").NetRay)
_ray:RegisterEvent("_"):FireAllClients("hi", 1, workspace)
Also, this doesn’t work when the client started before the server, for example, getting the event on ReplicatedFirst and then firing from server would cause the client to not get any data.
This is because if the server isn’t set up the event won’t exist etc, You can yield it using task.wait()
which should solve your issue or allow the server to set up (this would be only for the first player to join)
Tuples should already work with NetRay
Non-empty
A dense array (keys 1, 2, 3… N with no gaps)
Contains elements of the exact same, simple, supported type (like all NumberU8 or all String (<=255 bytes) or all Vector3S16, etc. - crucially not mixed types, and excluding nested tables, Instances, Buffers, Binaries, or Nils).
Then, it will be serialized using the efficient HomogeneousArray format (TypeCode 0xD0). This writes the element type code once, the array length, and then just the data for each element consecutively.
In this case, the serializer iterates through the table using pairs (which for an array includes keys 1, 2, 3…). It then recursively serializes each key (the number 1, 2, 3…) and each value individually.
The deserializer reads the key-value pairs and reconstructs the original array table.
It uses a highly efficient Homogeneous Array format if all elements are of the same simple type.
It falls back to a less efficient (but still functional) Dictionary format for arrays with mixed types or unsupported element types, serializing the numeric indices as keys.
I tried to do that but it just prints “hi”, since I use an effect system that constantly fires to all clients, I need to send all types of data, this including Instances all the way to Vector. Keep in mind I don’t send in a table, I just need it as individual arguments, as shown in the second snippet in my original reply.
Benchmarks Results
Bools
StructOfNumbers
Test place
Benchmark (2).rbxl (240.9 KB)
Edit:
Editing the max batch size resulted in a Huge performance improvement! and fixed benchmark place for netray v1.1.0 without throttling
Have you tried
_ray:RegisterEvent("_"):FireAllClients({"hi", 1, workspace})
I see what you mean now. When I tested it printed it as a table, and you don’t want that?
This worked and I just did table.unpack(...)
on client.
One more question, is it possible to get an Event from another script? I wanna have a single script register an event but have other scripts either get the event or fire the event without talking to the original script that registered the event.