#šŸ’½Programming Chat v2

1 messages Ā· Page 2 of 1

spare quartz
#

new instruction system is a lot simpler than the last

bronze venture
#

Programming chat v2?

#

Isn’t this like

#

V4

swift lake
#

It's v2

spare quartz
#

its time to panic

wraith scarab
#

i have to make an electron app

#

guh

#

help

#

not that its difficult i just have to do loads

lavish dove
#

I forgot I was doing that after 2 hours lmao

#

I kinda cheated a little bit though and just copy pasted the old one from my old project when I got to actually sending the status packet

timid quartz
spare quartz
#

i should port java native libraries and a TCP forwarder

lavish dove
#

I was trying to refactor it to use oop then my Internet gave out and now Minecraft won't even launch lol

#

It's out for my whole city too

#

I fucking pay 20 dollars and minecraft things it can revoke the right to use it when my internets out

full berry
#

that shouldn't be right

spare quartz
#

happy 100 modules!

#

also roblox sorts things weirdly

snow oak
#

to be honest, i dont really like using modules but i have to use them for pretty much almost everything i do Sadge

#

also this probably sounds like a silly question, but i've always wondered: should i use : or . when creating a function within a module?

snow oak
#

Last week

lavish dove
lavish dove
lavish dove
#

and now its still not reading a normal ass long

lavish dove
#

its just 24 lines when rewritten with oop lmao

umbral monolith
#

if you have something like module.new() that uses setmetatable

#

then you should use :

#

otherwise use .

timid quartz
#

@umbral monolith : automatically passes self right?

timid quartz
lavish dove
#

it sends the status thing every time I click refresh or reopen the multiplayer page

spare quartz
#

if you need a function that works on behalf of the table itself use :

#

otherwise use .

snow oak
#

alright, ty

spare quartz
#

its all sugar though so its not like you'll miss out

spare quartz
spare quartz
#

made a brianfuck interpreter cause a friend made a joke

#

he lp me

lavish dove
#

brainfuck is the best

#

imagine if we could syscall/interrupt from it

swift lake
#

ok so i gave up and now im making a minestom fork in kotlin

#

because this is very ugly and i hate it

timid quartz
swift lake
#

without mojang code

timid quartz
#

Interesting

swift lake
#

yeah

spare quartz
spare quartz
#

jvms going very well

#

now its only crashing due to a missing entry here

timid quartz
spare quartz
timid quartz
#

Hi cat

spare quartz
#

do you wanna see what i supervise for the last week

timid quartz
#

Sure

spare quartz
#

fun fact : this isnt even the program thats working

#

thats just initialization of System

timid quartz
#

I was waiting for the output to end in an error

spare quartz
#

oh it did

#

native error

timid quartz
#

Rip

spare quartz
#

not really

#

theres fewer and fewer corruption issues as time goes on

#

im happier to see native errors/instructions missing rather than

#

x not found in array index y (invalid)

spare quartz
#

i could MAYBE

#

run minecraft on it

#

when system gets initialized

#

since i can reasonably trust it around strings

#

(but not floats or longs)

timid quartz
#

I’m sure Minecraft has a few of those

spare quartz
#

not modern minecraft obv

#

the first version and going upwards

#

i have to plan ahead when it comes to filesystem ops too

#

considering im starting to fake that now

timid quartz
#

Brain hurty

spare quartz
#

oh trust me corruption issues fucking SUCK to debug

#

an improvement this jvm has over the last is data can be traced through out its lifecycle though

#

no pausing of execution needed

timid quartz
#

Nice

#

How’d you do that

spare quartz
#

restricted creation of ValueWithTypeInformation extremely heavily

#

the only parts where things get a little unclear is whenever a <clinit> frame is injected (you'll see two indents from a requsite call instead of one)

#

hmm

#

i should open source this

#

theres only one roblox library being used (httpservice)

spare quartz
#

oh fuck

#

i can overclock the jvm... to ~600,000 instructions per second

#

probably way off calculation

#

but its always the print statements slowing it down

spare quartz
spare quartz
#

debugger 2!

#

might add a rewind button

spare quartz
#

@wraith scarab okay so i optimized the old raycasters

#

and also created my own interlacing

#

and now we can have a lot of them as cameras!

#

upclose

proud creek
#

oh damn thats so cool

spare quartz
lavish dove
spare quartz
#

i decided to get on the minecraft thing too cause i hate myself

#

i got a packet!

swift lake
spare quartz
#

i made it multithreaded

lavish dove
spare quartz
timid quartz
#

C++ PTSD

spare quartz
#

prank em john

#

rn im working on gaussian blur and i hate it

timid quartz
#

Lol my phone really put an ellipsis character

spare quartz
#

god mouse is about to die

#

really annoying to copy text to check if thats rust

#

this isnt a 'struct'

#

its a package!

#

i really have to learn how ada internals work honestly

timid quartz
#

interesting that you define generics at the package level

spare quartz
#

we can do it at the function level aswell

#

thats just not possible here (visibility issues)

spare quartz
#

i know for a fact that using generics only one object is 'created' and its reused for all passed in types

timid quartz
#

interesting

spare quartz
#

i still dont know what formal means in generic's context

timid quartz
#

That Max_Size thing is pretty interesting

spare quartz
#

ohh formal as in FORMAT

spare quartz
#

an integer, at max, needs 5; a long, at max, needs 10

timid quartz
#

I see

spare quartz
#

more math to determine the minimum size a number could fit in

#

mouse STOP DYING

spare quartz
timid quartz
#

ugh I'm trying to get back to the top of this thread

spare quartz
#

#1264496483957346346 message

timid quartz
#

There

spare quartz
#

ugh i hate how im actually a moderately okay programmer now

#

just feeding myself tasks to keep myself busy

timid quartz
#

loool

#

can't relate

spare quartz
#

sure you can

#

you know how to code in rust

#

thats basically witchcraft

timid quartz
spare quartz
#

thats T'Size

#

this isnt something for the language itself

#

its to add support for a type LIKE protocol buffers variable length numbers to be transmitted over the wire

timid quartz
#

T'Size returns bit size?

spare quartz
#

size of the type in bits yes

timid quartz
#

interesting

spare quartz
#

also i need to update my checksum library i have on the alire index

#

oh yeah ++ i found out ada has JSON support under something called "GNATCOLL"

#

it restricts me to only the GNAT compiler but thats virtually the only one in existence (excluding HPs/Green Hills/etc. solutions)

timid quartz
#

There's no decent way in Rust to have a generic integer without using a crate

spare quartz
#

wdym by generic integer?

timid quartz
#

How you have type T is range <>

spare quartz
#

are your generics like

#

only allowed to be used with types with the same binary size/rep?

timid quartz
#

It’s not that, it’s just that there’s no one ā€œintegerā€ trait in the rust standard library

#

Generic constraints are done via traits in rust

spare quartz
#

oh

#

thats weird...

timid quartz
#

Like if you look up the stdlib docs for u32 you can see the sheer number of traits it implements

#

There’s a crate that has a Num trait but it’s separate from the stdlib

spare quartz
#

two other interesting tidbits i found while reading the advanced manual;;

  • all enumerations are parameterless functions
  • types are imaginary; they all resolve to their own sets of 'Base "machine types"
spare quartz
#

jesus

#

JESUS

#

theres hundreds???

timid quartz
#

Well you can do lots of things with an int

spare quartz
#

same in ada but like

#

types themselves don't implement anything

#

A.B (...);

B isn't actually apart of the type A; it just takes in A as its first parameter

timid quartz
#

The way it works in Rust is with structs and traits

#

Classes and interfaces if you prefer to think that way

#

Since the stdlib needs to be extensible both internally and externally it makes sense that they defined all those traits for a u32

#

So they could get shared to other integer types and also be used by people to make their own types do different things

timid quartz
spare quartz
timid quartz
#

It’s just the rust way of doing things

spare quartz
#

blanket implementations?

timid quartz
#

If you want generic constraints or want to share behavior in an interface-like manner, you use traits

timid quartz
spare quartz
#

aside from generics in ada you can't.. share functionality to another type (unless its a function that takes in a 'Class of a tagged record)

#

type A is new Integer; makes A incompatible with Integer

#

question about your atomics if you can answer; how are they defined in rust?

#

in ada atomics are values in memory that can be written to in one assembly instruction

#

(aswell as being "independent" (not sharing its space in memory w/ other objects) and "volatile")

#

i again learned this from the advanced course (that i should really read more its kinda interesting)

timid quartz
#

I’d imagine either one instruction ops or they pause interrupts

spare quartz
#

Each atomic operation is indivisible with regards to any other atomic operation that involves the same object. Atomic objects are free of data races.

#

thats the same definition as adas!!! omg!!

timid quartz
#

AIDS

#

LOL

spare quartz
#

i dont knowwhat youre taking abot,,

#

oh

#

note for future self dont use atomics/volatiles in threading

timid quartz
#

With rust you slap a type in the good ol’ Arc<Mutex<T>>

spare quartz
#

as far as i know in ada its either a PO (protected object) or a rendezvous

timid quartz
#

Does Ada have channels?

spare quartz
#

wdym

timid quartz
#

Like go-style channels for communicating between threads

#

I guess that would be rendezvous

spare quartz
#

a rendezvous is

#

again as far as i know i dont know much about this section of tasking

#

a thread waiting to reach a point in another thread thats the "messaging" point

timid quartz
#

Both threads basically wait until a certain point-

#

Yeah

#

There it is

spare quartz
#

yeah

timid quartz
#

Yeah hence I said it seems like a rendezvous

spare quartz
#

hold on when were rendezvous added

#

i gotta see if ada actually predicted things

timid quartz
#

Well if you really wanna check that

#

See if/when C++ added them

spare quartz
#

wow

#

Ada 83

timid quartz
#

Damn so Ada might have done it first

#

I’m sure some people did similar stuff in C first

spare quartz
#

well duh its C

#

what havent people done in it

#

REPORTED TO QIAD!!!!! MEANIE!!!!!

#

anything not tagged here is Ada 83 iirc

timid quartz
#

Was 83 the first edition?

spare quartz
#

yeah

#

Ada 80 was a preliminary version of the Ada programming language. The Military Standard reference manual was approved on December 10, 1980 (Ada Lovelace's birthday), and given the number MIL-STD-1815 in honor of Ada Lovelace's birth year.
The Ada 83 standard, MIL-STD-1815A, was later derived from Ada 80.
Ada 80 is just interesting from a histori...

#

this was the preliminary version

#

awww thats so cute

spare quartz
#

gaussian blurring done

lavish dove
# spare quartz

Need a new language like C where nothing you do is incorrect if it fuckin works

#

I swear I got a bunch of people mad at me for doing

asm("jmp main")

#include ... Fuck ton of functions

void main() {

}
#

That was only incorrect because it had to be linked though

#

But it worked really well lol

timid quartz
#

ada also

#

mayyyybe zig but probably not as much

lavish dove
timid quartz
#

unless you mean you want to be able to do ANYTHING you want as long as the syntax and types line up and not crash

#

which is impossible

lavish dove
#

Lol

#

Exactly

swift lake
#

so now im doing it from scratch again just on a version that doesn't require sending every registry to the client in order to login

spare quartz
#

There’s many warnings the compiler will tell you like

#

Having a type of ā€œnot null accessā€ in your function and not setting it to something

#

It’ll compile, but it tells you this’ll raise a Program_Error/Constraint_Error (forgot which) at runtime

timid quartz
# spare quartz Not so fast

Well I took what lucky said to mean ā€œif it compiles it worksā€ not ā€œI want to dereference a null pointer and not segfaultā€

spare quartz
#

That’s not what a null pointer is

#

It’ll crash the moment you load the function because immediately you’re violating the constraint

#

Not so much that it’s a segfault

#

If you wanted a program with like, basically zero protection against programmer error

#

I’d say… JS, Lua, or just downright assembly

#

Oh and C but that’s a given

swift lake
#

finally finished server list ping

lavish dove
#

Nice

spare quartz
#

be careful with resource managment here

#

iirc readBytes doesnt close the resource

timid quartz
spare quartz
#

:<<<<

odd flint
#

can someone help me with a script that im writing? im trying to make a simple one for a tycoon that destroys a block thats dropped from a dropper and then give points but its not working
this is my script

local player = game:GetService("Players")
local collector = script.Parent
local leaderstats = workspace.Leaderboard

local function onContact(hit)
    hit:Destroy()
    if hit and hit:IsA("Part") then
        local player = player:GetPlayerFromCharacter(player)
        if player then
            local leaderstats = player:FindFirstChild("leaderstats")
        else
            print("Player not found")
            if leaderstats then
                local money = leaderstats:FindFirstChild("Money")
                if money then
                    money.Value = money.Value + 1
                end
            end
        end
    end
    
    
    
end    




collector.Touched:Connect(onContact)

something isnt working in line 8
ive only been scripting for 3 days and i dont really know what to try anymore, ive modified the script a lot and tried something completely different before this and that didnt work either
if anyone knows whats wrong and could help me fix it i would really appreciate it

swift lake
#

yeah i just checked it does

spare quartz
#

probably got it confused with readAllBytes

swift lake
#

yeah

spare quartz
#

local player = … on line 8 should be changed to a different name since you’re shadowing Players

#

also instead of … = … + 1, do … += 1

burnt locust
#

I'm gonna learn Lua self guided

#

My goal: make a working gun that deals damage and had a headshot multiplier

#

Where do I start :D

#

@spare quartz you're the only physicist online so I'll ask u

spare quartz
odd flint
spare quartz
#

to the new variable name yes

odd flint
#

still doesnt work f_facebookcry

spare quartz
#

waaaaait

#

player:GetPlayerFromCharacter(player)
should be
player:GetPlayerFromCharacter(hit.Parent)
because youll need to be getting the character model to get a player

#
if leaderstats then
                local money = leaderstats:FindFirstChild("Money")
                if money then
                    money.Value = money.Value + 1
                end
            end

and this section of code should go into the if player then chunk of code;; replace "player" to the new name you have for the variable

odd flint
#

so like this?

local player = game:GetService("Players")
local collector = script.Parent
local leaderstats = workspace.Leaderboard

local function onContact(hit)
    hit:Destroy()
    if hit and hit:IsA("Part") then
        local subject = player:GetPlayerFromCharacter(hit.Parent)
        if subject then
            local leaderstats = player:FindFirstChild("leaderstats")
            local money = leaderstats:FindFirstChild("Money")
            if money then
            money.Value += 1
            end
        end
    end
end






collector.Touched:Connect(onContact)
spare quartz
#

hit:Destroy() should be done AFTER the if/not done at all

#

but yeah i think that looks okay

odd flint
#

it still isnt adding money
could it be cuz its not getting the right info from the other script?

spare quartz
#

add some prints to the code to see if its getting subject/leaderstats/money properly

odd flint
#

its never been getting player

#

ima see if its still doing that

#

its not getting subject

#

which is the issue that ive been having the entire time

spare quartz
#

and just to confirm you moved hit:Destroy() after the if statements

odd flint
#

yup

spare quartz
#

weird

odd flint
#
local player = game:GetService("Players")
local collector = script.Parent
local leaderstats = workspace.Leaderboard

local function onContact(hit)
    
    if hit and hit:IsA("Part") then
        local subject = player:GetPlayerFromCharacter(hit.Parent)
        if subject then
            print("found subject")
            local leaderstats = player:FindFirstChild("leaderstats")
            local money = leaderstats:FindFirstChild("Money")
            if money then
            money.Value += 1
                hit:Destroy()
            end
        end
    end
end






collector.Touched:Connect(onContact)

this is all correct right

spare quartz
#

i think so

timid quartz
#

I mean personally I'd do an inversion of thsoe if statements

#

but that's for style

odd flint
#

wait so

#

why does it need to get if the player touches the part if it never does

timid quartz
#

Wdym

#

what line are yoiu referring to

odd flint
#
local subject = player:GetPlayerFromCharacter(hit.Parent)
#

hit.parent

timid quartz
#

So normally what actually touches the part (hit) is one of the player's limbs/accessories/etc

#

Not the player's actual character

#

So it'll be something like Character.LeftArm or whatever

#

So you have to do hit.Parent to get the actual character model which is named after the player

#

Does that make sense @odd flint?

odd flint
#

that part makes sense but could that be messing up my script since the player never actually touches the part

timid quartz
#

No

#

There's a distinction between the "Player" and the "Character"

#

Both are linked to each other but both live in different areas

#

The character lives under workspace with all the other models and the player lives under game.Players

odd flint
#

player is ur data and character is the model?

timid quartz
#

Which is why, whenever the player's character touches whatever it is that you have, you have to say game:GetService("Players"):GetPlayerFromCharacter(hit.Parent)

#

To find the actual player object

timid quartz
#

meower beneath me

spare quartz
#

you don't need a character to be in a game, but you need the player

odd flint
timid quartz
#

Yeah

#

Well wait

#

oh wait

#

this is

#

entirely wrong

#

this is for when the BLOCK dropped by the DROPPER hits the end of the conveyor right

odd flint
#

it hits a block at the end

timid quartz
#

Right

#

@spare quartz this is entirely wrong

#

hit is not anything for the player

spare quartz
#

indeed...

timid quartz
#

hit is the block

spare quartz
#

okayyy lets come up with a new design then

timid quartz
#

I mean tbh

#

all you need is some way to link the player in

spare quartz
#

add an event to the burner thing at the end of the conveyor instead of the block thats being dropped

#

if the hit part is tagged blah blah blah then destroy it and add an amount to the (player who owns it)'s wallet (probably using an attribute on the dropped part)

#

if you wanna make the player able to collect the raw parts for money then add an event doing the above described

#

do note you dont need to clone a whole script for the part to add an event

#

you can attach an event where the dropped part is created

odd flint
#

can i just change this part

        local subject = player:GetPlayerFromCharacter(hit.Parent)
        if subject then
            print("found subject")

and leave

            local leaderstats = player:FindFirstChild("leaderstats")
            local money = leaderstats:FindFirstChild("Money")
            if money then
            money.Value += 1
                hit:Destroy()
#

or do i need to redo the whole thing

spare quartz
#

well to do the design i suggested you'd need to change a lot of things

#

but if the goal here is to..

#

have a script in the dropped part that adds this event

#

then instead of "subject" you'd check if the hit part was the collector part, i'd imagine?

#

and the player to add the money to would be in the collectors attributes?

spare quartz
timid quartz
#

bro atp

#

this stupid

#

doesn't work

spare quartz
#

"Up to twice the performance of native Windows."

#

what does this mean

odd flint
timid quartz
#

yesterday it segfaulted on open, today it is having a "general protection fault" on open

spare quartz
spare quartz
#

i wanna read into this thing later cause i dont like it initially

#

also this ramen is boiling me

odd flint
#

yeah i think so

#

doing

local collectorPart = workspace.DropperFolder.DropperItemCollector
``` fixed some of it
#

i have to modify more

spare quartz
# odd flint yeah i think so

okay so if its a collector script check if the hit part is tagged something, and add the amount of money its worth to the player who owns the collector's wallet

odd flint
#

tagged?

#

how would that work

spare quartz
#

alright, where are you creating the dropped parts?

odd flint
#

in a script thats connected to a click detector

#

or did u mean where are they spawning

spare quartz
#

like, can you show me the section of code where the part is created

odd flint
#

oh yeah

#

local dropper = workspace.DropperFolder.Dropper
local clickDetector = script.Parent

local function spawnBlock(whenClicked)
    local block = Instance.new("Part")
    block.BrickColor = BrickColor.Random()
    block.Position = dropper.Position
    block.Parent = workspace
    print("Done")
end

clickDetector.MouseClick:Connect(spawnBlock)

spare quartz
#

oh good you're not using the second argument of instance.new

#

alright so before "block.Parent = ..." run this method on the part

#

tag it whatever you'd like, just something clear to get it across "this is a dropper part"

#

after that, setattribute something on it to indicate how much its worth - default value... 1?

odd flint
#

so

local dropper = workspace.DropperFolder.Dropper
local clickDetector = script.Parent

local function spawnBlock(whenClicked)
    local block = Instance.new("Part")
    block.BrickColor = BrickColor.Random()
    block.Position = dropper.Position
    block:AddTag(dropper)
    block:SetAttribute(1)
    block.Parent = workspace
    print("Done")
end

clickDetector.MouseClick:Connect(spawnBlock)

#

this?

spare quartz
#

you need an argument before the 1 in SetAttribute, the name of the attribute

#

and the argument in tag must be in "" quotation marks

#

otherwise itll be a variable, not a string

#

just a mote of advice: you can add --!strict at the top of your script to see if you've made any potential problems

odd flint
#

im sorry im trying not to come off as a retard 😭 but it would be like this then right?

block:SetAttribute"value"(1)

if i put value inside of the () then it errors

spare quartz
#

:SetAttribute("Value", 1)

odd flint
#

o h

#

right

spare quartz
#

function "x" is syntaxically equal to function ("x"), but that's only for single argument functions

timid quartz
spare quartz
#

linux software
closed source

#

walking contradiction!

#

my main focus is here

#

what does it mean by that?

#

"android version of roblox" implies theres a JVM under the hood

timid quartz
#

well it uses the roblox apk so idk

spare quartz
#

both of these seem to be the ones coding the project

#

top suggests jvm, bottom suggests native

timid quartz
spare quartz
#

well it cant be "just native" if its an android bridge, again

#

unless theres something im misunderstanding

#

and cause its closed source i-cant-check

odd flint
#

this is what i have now

local player = game:GetService("Players")
local collector = script.Parent
local leaderstats = workspace.Leaderboard
local itemValue = workspace.DropperFolder.DropperButton.ClickDetector.DropperScript

local function onContact(hit)
    
    if hit and hit:IsA("Part") then
        local collectorPart = workspace.DropperFolder.DropperItemCollector
        if collectorPart then
            print("found part")
            local leaderstats = player:FindFirstChild("leaderstats")
            local money = leaderstats:FindFirstChild("money")
            local collector = itemValue:GetAttribute("value")
            if itemValue then
                money.Value += collector
                hit:Destroy()
            end

            end
        end
    end







collector.Touched:Connect(onContact)

but now im getting an error "Workspace.DropperFolder.DropperItemCollector.ItemCollect/GiveMoney:13: attempt to index nil with 'FindFirstChild'"

spare quartz
#

you need to get the player who owns the collector

#

in your code "player" is just a reference to the global players service

odd flint
#

in line 1?

spare quartz
#

correct

odd flint
#

so then it would be

local player = game.Players.LocalPlayer
#

right?

spare quartz
#

LocalPlayer is only accessible on the client side, while this should be a server side script

#

youll need to find some way to put who owns the collector inside the collector's attributes

odd flint
#

how the script currently works i think anyone can interact with it

#

regardless of team

#

i havent gotten far enough to make it team specific

spare quartz
#

well then i think youll just have to add it to everyone's wallet

odd flint
#

ill do that then i really dont care i just want it to work

#

so i can move on

spare quartz
#

to do that youll need to loop over the players in Players

#

for Index, Player in player:GetPlayers() do ... end

odd flint
#

hhuh

spare quartz
#

..?

odd flint
#

ive never used that before

#

hold on

timid quartz
#

@spare quartz sounds like you wrote this game

spare quartz
odd flint
#

@spare quartz i added it and it still does the same error

#

i might have done it wrong

spare quartz
#

show your code

odd flint
#
local Players = game:GetService("Players")
local collector = script.Parent
local leaderstats = workspace.Leaderboard
local itemValue = workspace.DropperFolder.DropperButton.ClickDetector.DropperScript

local function onContact(hit)
    
    if hit and hit:IsA("Part") then
        local collectorPart = workspace.DropperFolder.DropperItemCollector
        if collectorPart then
            print("found part")
            for _1, player in Players:GetPlayers() do
                local leaderstats = Players:FindFirstChild("leaderstats")
                local money = leaderstats:FindFirstChild("money")
                local collector = itemValue:GetAttribute("value")
            
                if itemValue then
                money.Value += collector
                hit:Destroy()
                end
            end
        end
    end
end






collector.Touched:Connect(onContact)
spare quartz
#

local leaderstats = Players:FindFirstChild("leaderstats")

#

player:FindFirstChild...

odd flint
#

oh wait i just realize

#

its a dif error

#

Workspace.DropperFolder.DropperItemCollector.ItemCollect/GiveMoney:18: attempt to index nil with 'Value'

spare quartz
#

local money = leaderstats:FindFirstChild("money")

#

does the player have "leaderstats" in their player object

odd flint
#

they should

#

its in the leaderboard script

spare quartz
#

play the game and go to your explorer

#

look inside your player object

odd flint
#

yup its there

spare quartz
#

odd

odd flint
#

wait maybe

spare quartz
#

and you did change the Players inside the loop to player right

odd flint
#

i should try changing it from leaderstats to Money

odd flint
#

mm ok that didnt fix it

#

leaderstats is the folder but money is inside it so ig it should be money

#

unless thats wrong

spare quartz
#

oh yeah

#

its case sensitive so

#

money should be Money inside the script

odd flint
#

ok that fixed part of it

#

however now im getting "Workspace.DropperFolder.DropperItemCollector.ItemCollect/GiveMoney:18: attempt to perform arithmetic (add) on number and nil"

spare quartz
#

remove
local itemValue = workspace.DropperFolder.DropperButton.ClickDetector.DropperScript
and change
local collector = itemValue:GetAttribute("value")
to
local collector = hit:GetAttribute("value")

odd flint
#

oh wow it works now

#

thank you so much

#

ive been trying to fix this for 3 days now

spare quartz
#

get back to lua learning now!!!

#

i do not deserve thanking

odd flint
#

once im done learning im going to make

#

rcl tycoon

#

Real

timid quartz
#

@spare quartz THIS IS LITERALLY YOU

spare quartz
#

but one day youll be pretty good at it

#

so good luck with it

odd flint
#

thank you

#

learning enough then i guess

#

do u think that i can learn enough to make a basic tycoon in

#

a month?

#

2 months?

spare quartz
#

however long it takes you

#

im bad at estimates

odd flint
#

oh and it doesnt even destroy my body anymore

#

added bonus

odd flint
#

@spare quartz should i bother "fixing" my script if it errors but still works

pastel tinsel
#

Errors can cause lag

odd flint
#

oh!

spare quartz
odd flint
#

@spare quartz i neeeeeeeeeed your help again

#

my code is erroring for no reason

spare quartz
#

it always has a reason

odd flint
#
local speedBoost = script.Parent

local function onTouch(otherPart)
    local character = otherPart.Parent
    local humanoid = character:FindFirstChild("Humanoid")
    
    if humanoid.WalkSpeed >= 16 then
        humanoid.WalkSpeed += 16
        wait(10)
        humanoid.WalkSpeed -= 16
    else
        print("Walkspeed too fast")
    end
end

speedBoost.Touched:Connect(onTouch)

i dont understand theres no errors and it still runs it just throws "Workspace.SpeedBooster.SpeedBoosterScript:7: attempt to index nil with 'CharacterWalkSpeed'"

spare quartz
#

if humanoid.WalkSpeed >= 16 then
to
if humanoid and humanoid.WalkSpeed >= 16 then

#

:FindFirstChild COULD give you something, but it also can't

#

"humanoid and"... ensures humanoid exists cause in lua

#

anything thats not nil or false is true

odd flint
#

oh that works

odd flint
#

that looks kinda satisfying...

odd flint
#

@spare quartz can u help me with something again (sorry to bother u again)

spare quartz
#

?

odd flint
#

im trying to make a team script for a game

#

i think the parameters might be wrong but i tried different stuff and same result

#
wait(5)
local Players = game:GetService("Players")
local Team = game:GetService("Teams")
local teamNeutral = game.Teams.Neutral

local function setTeam(Team)
    
    if Players.Team and Players.Team ~= game.Team["Neutral"] then
    Players.Team = game.Team["Neutral"]
    else
        print("no")
        
    end    
end

spare quartz
#

you should use task.wait instead of wait; wait is deprecated

#

teamNeutral can be changed to Team.Neutral because Team is a reference to game.Teams

#

you do not need "Players.Team and" when you are doing a comparison like "Players.Team ~= game.Team["Neutral"]"

#

finally; "Players" here, is again, a reference to the Players service, and not the player you're possibly talking about

#

is this a local script or a server script

odd flint
#

server scruot

#

script

#

i want it to affect every player

spare quartz
#

then you need to run it over every player like you did with the last collector script

#

look at the loop for details and change "Players" in that function to the secondary loop parameter

odd flint
spare quartz
#

no

#
local neutralTeam = Team.Neutral
odd flint
#

oh f_facebookcry oops

#

ok

#

do i also have to do

for _1, player in Players:GetPlayers()

cuz it still doesnt work

spare quartz
#

wdym it still doesnt work

odd flint
#

doesnt team

spare quartz
#

show your code

odd flint
#
task.wait(1)
local player = game:GetService("Players")
local team = game:GetService("Teams")
local neutralTeam = team.Neutral

local function setTeam(team)
    
    if player.Team ~= game.Team["Neutral"] then
    player.Team = game.Team["Neutral"]
    else
        print("no")
        
    end    
end
swift lake
#

thats why it doesnt work

#

i think this is what you're trying to do, right?

task.wait(1)
local Players = game:GetService("Players")
local Teams = game:GetService("Teams")
local neutralTeam = Teams.Neutral

local function setTeam(team)
     for _, player in pairs(players:GetPlayers()) do
           if player.Team ~= neutralTeam then
                  player.Team = neutralTeam 
           else
                  print("no")
           end
     end    
end
odd flint
#

i think so?

#

what does the in pairs part mean

#

ive never used that before

swift lake
#

its how you can loop/iterate over arrays

#

one of the many ways to do it at least

spare quartz
odd flint
#

ohh ok

spare quartz
#

pairs/ipairs is deprecated in modern Roblox luau

swift lake
odd flint
#

i dont think ive ever really messed with arrays before

spare quartz
#

whatever the case avoid using them

spare quartz
#

Tables (arrays AND dictionaries)
Arrays (a subset of tables indexed by numbers)
Dictionaries (a subset of tables indexed by everything else; i.e. strings)

odd flint
#

i never got to that part of the lua documentation on the creatorhub

#

i thought i would just learn it when i needed it

spare quartz
#

Well when you’re thinking about setting more than one of something you’re gonna have to look at sets/collections of items and looping over them

odd flint
#

ok so i should probably look at that part of the document then

odd flint
odd flint
swift lake
#

yes

#

im a little sleepy rn

odd flint
#

still doesnt work

swift lake
#

how r u using it

odd flint
#

do u mean like where is it located?

swift lake
#

no like

#

how are you calling the function

odd flint
#

oh

#

oh my god im so retarded

#

i just realized that i was never calling it

#

pi huwrYiuiethiubrabuy

#

maybe it would have worked all along if i had been doing that

#

lets see

#

@swift lake would a while true loop with a delay work

swift lake
#

why..

odd flint
#

oh

#

i didnt know about those

#

Ok

odd flint
#

cuz if i do IsRunning() then wouldnt that just be the same thing as a while true do loop

swift lake
spare quartz
#

polling; i.e. waiting indefinitely for something to be true should always be the last resort

#

Roblox is primarily event driven; it’ll call on events you attach to do the work

odd flint
#

what if i triggered the script when they touch the spawn block

#

and put something in to not team them if theyre already on another team

spare quartz
#

That already exists on the default spawn block

#

Look for the team property

odd flint
#

oh i see

#

is there any way to code in exceptions

#

so that players already playing dont get teamed to neutral

spare quartz
#

Not sure through the part strictly

#

You might have to code it yourself

odd flint
#

how do i even set the team in this

#

theres color

#

but not team

spare quartz
#

the team color is the team

#

Roblox stuff

odd flint
#

so do i do team color along with team name

pastel tinsel
spare quartz
#

AFAIK yes

#

but I could, again, be confusing it for obsolescent

#

either way don’t use it

spare quartz
#

but it’s either or

#

Assigning a team on the Player object using the instance works just as well as assigning the team color on them either directly or thru the spawn part

#

@odd flint ping cause I made a mistake replying ^^

swift lake
odd flint
#

and or is there a way to make a default spawn team without scripts

#

(i dont know studio very well)

spare quartz
spare quartz
odd flint
#

when i press play sometimes i get teamed to another team

spare quartz
odd flint
#

btw u can reply ping me i have ping sounds off even tho im not on dnd

spare quartz
#

Is AutoAssignable false on every other team and only true on Neutral

odd flint
#

oh

spare quartz
#

// or do you not have a neutral team (that’s okay)

odd flint
#

i didnt know that i could do that

#

yeah my default team is neutral

#

if i knew that existed

#

i would have saved myself the headache of this script..

#

womp womp..

#

well u live u learn ig

#

Ok now time to figure out how to make a dropper script that identifies with a specific player

#

but first i have to make a script that teams a player to a team when touching a part

#

or passing through

#

however that work

#

s

spare quartz
spare quartz
timid quartz
timid quartz
spare quartz
#

but without syscalls

#

and a stack and

#

:<

timid quartz
#

:3

#

We make our own syscalls and stack in this house

spare quartz
#

i hope you forget to run halt on a modern intel cpu and it causes the processor to waste as much energy as it can

timid quartz
#

I hope your program isn’t expressible under Ada’s safety rules

spare quartz
#

you know what?

#

i hope your program doesnt contain coherent instructions, and its execution is determined based on the trash data located at the part of memory where it's PC starts at

timid quartz
#

I hope you compile your program successfully but encounter an unsupported instruction error when you go to run it

#

And that the correct compilation target is no longer available

spare quartz
#

when doing a bare metal target cause i didnt actually set up GNAT Studio to work with embedded

#

using the default run setting will cause an UNSUPPORTED_INSTRUCTION_ERROR or a protection fault

#

depends on if i do anything before running cli

#

i wonder if its possible to trick a linux kernel into throwing a fault in the double fault handler

timid quartz
#

Wow damn

spare quartz
#

wonder how restricted this is

swift lake
#

lmfao did github just go down

spare quartz
#

hmm

#

wonder if its possible to check if a port is already binded to w/o attempting to bind to it and checking for an error

#

also really need a generic one day

spare quartz
spare quartz
#

THATS WHAT IM SAYING

#

or more accurately... LUA

timid quartz
#

Lua doesn’t have that kind of construct?

spare quartz
#

it does

#

not the destructuring - duh -

#

but pcall is literally identical to the values returned there

timid quartz
#

Ohh right yes

#

Pcall

odd flint
#

@spare quartz doing lua local player = Players:GetPlayers() should work right? or not im still having problems with the different ways of getting player

proud creek
#

LOL

#

im deleting it cause it has a slur

spare quartz
#

OH

#

i didnt even watch it all the way 😭

proud creek
#

šŸ’€

odd flint
#

OOOOOL

odd flint
#

i wasnt sure how do do that

spare quartz
#

server deals with multiple clients at a time

#

its not possible to just get "one"

odd flint
#

wait then

#

i would want local

#

cuz its only gonna team 1 player

#

i think

spare quartz
#

in a local script its just Players.LocalPlayer

odd flint
#

i had that but it wasnt working

spare quartz
#

well if you do that on a server script it wont do anything

odd flint
#

attempt to index nil with 'team'

spare quartz
#

also

#

you cant team a player locally

odd flint
#

right?

#

whoops forgot to turn ping off

swift lake
#

thats a localscript??

#

it needs to be

#

on the server

odd flint
#

how was it working before then

swift lake
#

idfk

spare quartz
#

probably because it only changed your local clients perception of the game

#

if you switched to server you'd see thats not whats happening

odd flint
#

oh i see

#

so would it be

#

hold on

#
script.Parent.Touched:Connect(function(teamPlayer)
#

@spare quartz ?

timid quartz
#

It goes ```lua<ENTER>

#

Has to be a newline after whatever lang you put

swift lake
#

dont you just love intellij

lavish dove
#

lol

spare quartz
#

hey everyone

#

new developments to our mod

full berry
#

chat..

#

:(

odd flint
#

@spare quartz how would i fetch a local player for a server sided script

#

unless thats not how u do it

spare quartz
#

You can’t

odd flint
#

so what would i do then

#

i tried this

game.Players.PlayerAdded:Connect(function(plr)
    player = plr
end)
#

but it didnt work

pastel tinsel
full berry
#

you need to install it separately now which is just bleh

pastel tinsel
#

Not a big deal

#

Like I said

odd flint
#

i also tried

player = game.Players:GetPlayerFromCharacter(script.Parent)
full berry
spare quartz
#

writing. documentation.

timid quartz
#

@spare quartz I'm gonna sit in on a data structures class I already took, do I speedrun the data structure they're learning in C or C++

timid quartz
#

Idk lol

#

C++ has templates which is like the only thing it really has over C

spare quartz
#

uhhh.. maybe C?

timid quartz
#

but also just ints lol

spare quartz
#

well yeah but templates can also be a PITA (or so ive heard)

timid quartz
#

they ARE

#

like

timid quartz
#

end users can also do this themselves

#

but for example

// whatever.hpp
template<typename T> class Whatever { /* ... */ }
// whatever.cpp
template<typename T>
Whatever<T>::Whatever() { /* ... */ }
//...other implementations

template class Whatever<int>
//...further additions for types
spare quartz
#

weird

#

i think i dodged a bullet by using ada over c++

timid quartz
#

probably

umbral monolith
#

@trail beacon

trail beacon
spare quartz
#

\n is not an identity

lavish dove
umbral monolith
#

yup

timid quartz
timid quartz
#

regedit is windows lol

spare quartz
timid quartz
#

arraylist ā¤ļø

#

c++ is also interesting but so much template stuff

spare quartz
#

im bouta pass out from tiredness

timid quartz
#

go sleep

spare quartz
#

i just did

timid quartz
#

maybe I should try this in zig too

spare quartz
#

just with my eyes open

timid quartz
#

the allocator thing is neat and I kinda wanna try that

timid quartz
spare quartz
#

im primarily focusing on the list part

#

i could try and do that... probably wouldnt look too great though

#

okay what the hell this just isnt firing

#

it is??

#

oh my god its consuming the exceptions 😭

timid quartz
#

lol what

#

how and why is it consuming exceptions lol

spare quartz
#

i dont know??

#

there were two TODO()s that would crash the game if they were hit

#

but SOMEHOW the screen stuff was just... ignoring them

timid quartz
#

maybe to avoid crashing the game wheeze

spare quartz
#

oh cmon

#

it crashes on like every other little thing

spare quartz
lavish dove
spare quartz
lavish dove
#

I want a free multi terabyte ftp account

spare quartz
wraith scarab
#

since the input data remains the same even if you send out new data by passing final

spare quartz
#

couldnt be in that old code

wraith scarab
#

so using texture() is always against the original data

spare quartz
#

the gaussian matrix wouldn't add up to 1, so you have to take a sum and divide the value by the sum to get a normalized value

wraith scarab
#

no i mean for writing stuff to final variable

#

just stuff it inside the top loop

#

that's what ive always done and it's worked fine

spare quartz
#

this is the new code

wraith scarab
#

ok yeah thatsgood

spare quartz
#

wait that vec4 color is unused

#

removed, probably a remnant..

wraith scarab
#

o ok

#

sorry im busy building an inhumane chicken farm in minecraft

spare quartz
#

šŸ’€

spare quartz
wraith scarab
#

so can you not edit any vertex shaders at all?

spare quartz
#

We can override core vertex shaders, post processing vertex shaders are a little harder but also modifiable

#

(Only one PP shader can run at a time without me messing any of the internal code)

snow oak
#

alright so should i use modules for coresystems (eg startup, thermals, meltdown)

spare quartz
#

depends on design,,,

pastel tinsel
#

it really

#

does

#

a lot

spare quartz
#

thread colorizer

#

hmm what if i colorize both

spare quartz
#

final logger

#

final fixed

spare quartz
lavish dove
#

What the actual fuck is that

spare quartz
#

the legendary 4 point misdirection

wraith scarab
#

POINTER POINTER POINTER POINTER

timid quartz
#

int - pixel
int* - row
int** - frame
int*** - array of frames (which is what a video is basically)
int**** - pointer to array of frames

lavish dove
#

well it cant actually be a video

#

because having int ** to describe the pixels would waste width*8 bytes

#

and be slow as hell

lavish dove
#

I found a github wiht the same stuff in it

spare quartz
lavish dove
#

my god if college makes me do assignments like that im gonna fucking kill someone

spare quartz
#

post by person who said they needed to dec a video efficiently in only C

#

and they used the 4 misdirects as a multi-d array (like what aera said)

lavish dove
#

wow

#

Dr. Morteza Yousef Sanati

wraith scarab
#

my college made me do opengl c++ dev and i somehow got 87%

#

even though my models were shit they said my project was one of the best

#

oh and the shadowmaps were fucked because i didn't have enough time to fine tune the projection matrix for it

#

so it was inefficient and pixelated but i just threw percentage closer filtering at it

#

and it gained me marks šŸ’€

#

now these new meds have made me forgetful af and now I can't code properly anymore

full berry
#

i am BACK after a month off an on and off break

#

glad to see that this thread consisting of like 3 active communicators surpassed other threads with like much more people

odd flint
#

@spare quartz question
how would i disable a script via another script
i tried script.enabled = false but that doesnt work for some reason

wraith scarab
spare quartz
#

you CAN:

  • clone a disabled script
  • reenable that disabled script to run
#

though if your system revolves around arbitrarily disabling code execution whenever its not a good system (this isn't an APIC)

fallen moss
#

I mean, correct me if I am wrong, but I am pretty sure that will work

odd flint
wraith scarab
#

no

#

wot

full berry
full berry
#

why do i see a lot of open source code fellas use underscores as variable names
like not even as consts or anything (Talking about the JS/TS universe here), but mostly like inline arrow functions or inline error handling (.catch)

#

like matter of fact i tried these

.catch(err => console.log())

and

.catch(err => console.log())

For the first one, my editor gave me a warning before it commited that err was an unused variable, but when I used the 2nd example, then there was no error?

odd flint
umbral monolith
#

anyway "_" is the discard name

#

it mutes warnings about unused variable names

#

and all it needs to do is start with it

#

so "_err" is muted but is still readable as the error

#

really basic example: ```ts
function add(a: number, b: number, onAdd: (any, number) => void)
{
onAdd(false, a + b);
}

add(2, 3, (_useless, result) => console.log(2 + 3 = ${result}));

#

i am not interesting in using the first paramater, but i have to define it if i want to use the second one

#

giving it a name without _ will bug me about it being unused, so I add it in to mute that

odd flint
spare quartz
#

disabling it before the game starts

odd flint
#

oh

#

i

#

didnt think of that

#

thanks

wraith scarab
full berry
odd flint
#

@spare quartz can u look at a small section of code that im using its ancient and broken and idk how to start fixing it ytbitingnails

#

i dont really understand it

#

at all

full berry
#

And any errors that get thrown

#

Let me get a good reporting guide

#

How to Get Help

  • Before asking: Try to find the solution yourself. (CTRL + F in this specific channel might help you)
  • Skip "I need help", "Help please", "Can I ask a thing", "I have an error" - It wastes everyone's time. Follow the "How to as a question" guide below.
  • This channel can be used to get "help and support", however please take longer sessions out of this channel into DMs.

How to Ask a (Good) Question

  • Show your code.
  • Show your errors.
  • Explain what happens and what you want to happen instead.
  • Text is usually better than screenshots. Use code blocks starting with ```lua.

Help Us to Help You

  • Run your code before asking if it can work. (errors are often very useful in pin-pointing the issue! )
  • Imagine you are the one trying to help. Ask the question in a way that you would want to read!
  • Post your full error and the code surrounding that error.
  • If you use custom functions in your snippet, show them to us! (we only know how lua works, not how you defined custom functions)
  • Actively participate in the "solution-finding" process. (don't expect people to fix the code for you)
  • Explain what you tried to do to fix the problem.
  • Read the responses you are given.
  • Research key words you do not understand before asking what they mean. (come back and ask, if you cannot find them)

No Answer?

  • Do not mention uninvolved people to get a response.
  • Try to rephrase your question.
  • Try to give more context / improve your description.
  • Try to find a solution yourself while waiting.
    -# Taken from the DJS server.
odd flint
# full berry Show the code bro
tool.Equipped:connect(function()
    wait()
    body.Torso = tool.Parent:FindFirstChild("Torso")
    body.LeftArm, body.RightArm, body.LeftShoulder, body.RightShoulder = tool.Parent:FindFirstChild("Left Arm"), tool.Parent:FindFirstChild("Right Arm"), body.Torso:FindFirstChild("Left Shoulder"), body.Torso:FindFirstChild("Right Shoulder")
    if body.LeftArm and body.RightArm and body.Torso and body.LeftShoulder and body.RightShoulder then
#

this may have something to do with it

full berry
#

that would be my guess

#

ig you're using one of those nil variables

odd flint
#

how do i find which

#

nvm

#

its these ones

#

odd cuz the line where findfirstchild is nil has a value assigned to it

odd flint
#

oh

#

ok so it turns out

#

the script was erroring because i was playing in r15 and not r6

#

so smart!!!!

full berry
full berry
#

It's common sense more than anything

odd flint
#

buh???

full berry
#

but

#

i think its

#

game.workspace.

#

whatever

#

W might be capital

odd flint
#

no workspace is lowercase

#

and u dont need game.

#

i have the exact same thing in another script

#

but it doesnt work here

#
                local click = workspace.Tycoon.GunBuyer.GBClicker.ClickDetector
                click.MaxActivationDistance = 10
#

here it is in the other script

    local click = workspace.Tycoon.Droppers.Dropper1.Dropper1Button.ClickDetector
spare quartz
wraith scarab
lavish dove
#

I tried vulkan but gave up immediately and when I made some shitty renderers in opencl it was way easier to use than vulkan plus it let me control every little thing and was still so simple

#

How tf did khronos even make an api thats so difficult to use

#

like gpu's are literally just coproccessors with fancy graphic abilities??

#

opengl was also so cool and then khronos made it difficult and imperfect lmao

#

idk what im saying I just dont like these api's because from my limited experience they arent that good

#

even opencl has alot of useless stuff in it

full berry
snow oak
# odd flint <@516049910622191626> question how would i disable a script via another script ...

so what i would do (this is extreme even though i do it sometimes) is to create a bindableevent inside one of those scripts, then fire the event whenever you'd like to disable it

then inside the script that you want to disable, you can create a function when the bindable is fired that disables itself:


local bindable = script.BindableEvent
bindable.Event:Connect(function()
  script.Enabled = false
end)

#

this is a bit more of an advanced way to do it but oh well

odd flint
#

i just ended up disabling the script in studio manually and then enabling it later with a script

#

ill keep this in mind for the future tho

#

thanks

snow oak
#

you're welcome :)

burnt locust
#

I'm learning python

lavish dove
full berry
hybrid hornet
spare quartz
#

this normal

full berry
jolly lake
#

alrighty I'm here to bash my head again

#

so

#

bit of a story for context first (turns out I fixed my issue without realizing it so I'm gonna make a bit of a tutorial for people with the same issue)

jolly lake
#

well, automod didn't like my tutorial

#

so, uh no tutorial for now sorry

lament kite
#

"Tutorial on how to fix VSCode not importing Python packages installed inside a Virtual Enviornment"

https://docs.google.com/document/d/1_3aGQN7ta4ePKPCkrFxgqq4T4EbhGHjBpd-6Pa9Sz_c/edit?usp=sharing

#

-@jolly lake

jolly lake
#

Thank you

lament kite
#

yw

jolly lake
hybrid hornet
full berry
#

why are like