#code-discussion

1 messages · Page 84 of 1

raven sonnet
#

ig il just use it for now

#

works how i wanted

ancient halo
#

How to play an animation backwards from the begging?
Actually I need to loop the animation. However if i just make it looped it would look choppy. Thats why I want it to play then to play back etc

ancient halo
stable urchin
ancient halo
stable urchin
#

if it looks bad in any way, please make a recording of it and share

stable urchin
ancient halo
#

cuz the animation just started playing

#

it will go back to 0 cuz of the reverse

#

and will stop

stable urchin
#

hm

#

even when looped?

ancient halo
#

lemme see

ancient halo
#

cuz it will never stop

#

i tried it with a while loop

#

but still looks weird

stable urchin
stable urchin
ancient halo
stable urchin
ancient halo
#

but loop it smoothly

#

thats why it should play backwards when stopped

terse canyon
#

I read this and thought I was seeing things

languid bison
#

I wrote this quick script to set the color of an R6 Dummy's arm to a specific color and it doesn't work. What did I do wrong? Can colors from the color wheel not be applied to arms?

fading bramble
#

I wanna be a hirable scripter but I feel like I'm still too bad for it, what are some projects I can do to improve? I dont wanna create a whole games by myself cuz building it and making ui, animations etc is just not for me

uncut bear
#

cant find the problem, can someone help?

dark juniper
uncut bear
#

it does, i have it as a tool

velvet zinc
#

i need help with this, how come big games with parts that go up to 100k+ parts and they dont crash or lag, while my car game has 209,949 parts (basically because of the map and cars i have in game) just immediently crashes in 15 minutes.

#

done that

#

already

keen frigate
#

how do i take down my hiring posts?

#

wrong channel

pulsar apex
stable urchin
weak radish
weak radish
#

What happened to the singular line 😭

#

Use for loops bro

stable urchin
neon plover
#

chat has AI crashed out?

stable urchin
#

oh my bad

#

you're another dude lmao

#

the code I posted isn't relevant for what you had in mind

stable urchin
#

I just edited it and commented out UI code since I didn't have the UI locally

weak radish
weak radish
#

why were you using oncharacteradded in a local script

#

if gameProcessed then return end

if input.KeyCode == Enum.KeyCode.C then 

is so dumb

#

just use and statements

#

oh fairs you had two if statements

#

but for drainEnergy just start the function with if not isRunning return end

elder anchor
#

guys who wants to collaborate? i am making a game i need scripters . For who wants ….write me in private!

fair onyx
#

any scripters that wanna be hired?

stable urchin
#

I'd also personally use contextactionservice

#

but those aren't the problem in this case

weak radish
stable urchin
#

?

#

it's a local player script, not character script

weak radish
#

Does it say it's player?

stable urchin
#

no but that's implied

#

otherwise it's indeed pointless

weak radish
#

They had an if statement saying if player.character then
oncharacteradded()

#

I'm not saying that means it's player

#

But I'm saying I wouldn't assume it's not character

stable urchin
# weak radish Are you sure? Send the new script

to give them credit it's indeed the method you should use if using number range 0-255 though that's not cause of the error. I also briefly looked into it and assigning to Color with a Color3 should work if it's just a part

weak radish
stable urchin
tender badge
#

already did it for you

tender badge
#

wsp found out you took down the commission once I sent you the code and you never responded/payed me

hard wolf
#

how do you guys animate cutscenes from moon animator?
I found moonlite by maximumadhd works, but it doesnt play the rig animations, only the camera stuff
what do you do about rigs in a cutscene

languid bison
cerulean void
#

ayo

stable urchin
unkempt bay
#

yall i need help 😭 , i made an animation with moon animator and it has rig animation and camera so it transformed into moon 2 file , how do i script the animation of the rig and the camera to work when a player clicks on a gui screen ?

stable verge
#

just put the rig character you want in starter player and name it "StarterCharacter"

full ruin
#

Im new to lua i know c#,python, js and html and i want some help in lerning can someone help me te learn?

gloomy kiln
#

I'm starting to learn coding but I have a question

#

What's the difference between

#

for loops and

#

while loops

full ruin
#

for is when you know how much time you want to do the thing and while is when you dont know the spesific times it going to take it antil something happend

#

is this explain?

lunar charm
compact shell
#

if you change a value with a local scripts, can other local scripts from the same player see the changed value?

lunar charm
# gloomy kiln I'm starting to learn coding but I have a question
for = 1,5 do
  print("Output: "..i)
end

--[[ Outputs
Output: 1
Output: 2
Output: 3
Output: 4
Output: 5
]]

local condition = false

local count = 0

while condition ~= true do
    if count ~= 5 then
      count += 1
      print("Output: "..count)
    else
        condition = true
    end
end
--[[ Outputs
Output: 1
Output: 2
Output: 3
Output: 4
]]
gloomy kiln
#

ooh thanks

open sparrow
#

guys give me some complex tasks i can ask the premium AI to do, i wanna know how smart he is

lunar charm
open sparrow
# lunar charm explain why anything indexed by 0 is 1

Whenever you see a “zero‐indexed” value equal to 1—like
0
!
0!,
𝑥
0
x
0
, or
(
𝑛
0
)
(
0
n

)—it’s because each definition is really a product over zero factors. By convention, the product of nothing (the “empty product”) is set to the multiplicative identity, 1. This keeps factorials, exponent rules, and combinatorial formulas consistent without special cases.

shy harness
#

wtf

open sparrow
#

i want smth harder

#

i really want to test it

#

how smart could it be

copper apex
#

Prove the Riemann Hypothesis

open sparrow
copper apex
#

How to get more qubits

open sparrow
# copper apex How to get more qubits

To access or build systems with more qubits, you typically need to:

Choose a high-qubit platform (e.g., IBM’s Condor at 1,121 qubits, Atom Computing’s neutral-atom chip at ~1,180 qubits, or D-Wave’s Advantage2 at >1,200 qubits).

Use cloud services (IBM Quantum, IonQ, Rigetti, etc.) which let you run on their largest processors without owning hardware.

Improve hardware design (advanced fabrication, 3D interconnects, error suppression) to scale physical qubit counts and reduce noise—while also implementing error correction to turn many physical qubits into fewer logical qubits.

daring lance
#

yo who tryna work for me

open sparrow
red kestrel
#

Hey, I'm looking for someone to make a game with — preferably a scripter, since I mostly do modeling and animation.
It’s more of a collab than a job or anything, but I really want to learn more about scripting too. I'm just looking for someone who's actually into making a game and down to learn along the way.
You gotta be trustworthy, reliable, and just… normal. I’m not trying to partner up with someone who’s super childish. Thanks for reading if u are interested DM me.

fading bramble
#

I wanna become a better programmer, what is some system I could make which should teach me a lot of things and level up my skills? ( I dont want it to be too easy and I dont want it to be a whole game )

stable urchin
#

deobfuscation module
I don't see how the two go together

stable urchin
#

you can sink a lot of time into them

#

nifty features like lead prediction accounting for projectile gravity and target acceleration, firing in bursts for accuracy, working with any orientation of turret

stable urchin
terse vector
#

apply to lockheed martin, put this in your resume

stable urchin
terse vector
#

It's quite impressive, good work

stable urchin
#

thanks

#

it's gonna be funny seeing a friend fly a heli, then walking over to a generator, flipping its switch and watching 5 now-powered centurions and SAMs lighting up your friend's heli

stable urchin
fading bramble
#

Ive realized that I never used module scripts in my game, can anyone give me an example when would u use it?

stable urchin
#

features like mantling, wallrunning, bars that you can grab and swing with

stable urchin
#

before I start over explaining

fading bramble
#

that u can put your functions and variables inside of them and use them in other scripts

#

well I know how they work, I just cant think of a situation where I would need it and I know that in a lot of game people use them a lot

open sparrow
stable urchin
stable urchin
#

so we have various 'services', basically gameplay elements, on the server

fading bramble
#

could u show me like one of the scripts and the normal script where u use the module one?

stable urchin
#

a bunch of controllers, basically clientside gameplay elements, on the client

#

and a pattern I use very often with modules is what I like to call environment-based

open sparrow
stable urchin
#

the issue with modulescripts is that you can't pass information to them

#

so I got around that by having the modulescript return an 'initialization' function which takes in the necessary data in the form of arguments

#

I don't want to leak a bunch of code, so here's a mostly empty one that's going to be worked on

#

and then cleanup is also trivial

#

either this environment returns a cleanup function, or the cleanup function becomes part of the Environment table to be called externally

#

also, logical seperation

#

all of the modules you see in that screenshot use the environment pattern

fading bramble
#

why not keep it in a single script?

stable urchin
#

especially so with the structured script pattern I use

fading bramble
#

then why module scripts and not normal scripts?

stable urchin
#

if you have 15 different loosely related functions it becomes a PITA to navigate

stable urchin
#

grouping related code

#

and with normal scripts you can't delegate related code

full vortex
#

anyone got any reccomendations for learning scripting? ive just been watching thedevkings tutorials and doing the scripts in RS while taking notes

stable urchin
full vortex
#

im a complete beginner btw

stable urchin
#

@fading bramble keep in mind TurretAI is 300+ lines of code

#

that's 300 lines of extra searching- and scrolling to write and maintain code

fading bramble
#

Idk I think this one is a too complicated example...

stable urchin
#

my friend's first gun system was thousands of lines long

#

it was nigh unworkable

#

ever since he started embracing modulescripts he hasn't gone back

stable urchin
#

so that I can familiarize you on how to chop up code and seperate it into various modules

fading bramble
#

nope that why I was asking for the ideas for learning

stable urchin
#

hm

#

I suppose autonomous turrets are a candidate

fading bramble
#

but I realized that maybe ill finally learn module scripts

stable urchin
#

have you ever used them?

#

or do you only know them on a theoretic level

fading bramble
#

nope never in my life

stable urchin
#

ah

fading bramble
#

I only watched a tutorial on module scripts when I was learning scripting

#

but I never really touched them

stable urchin
#

honestly I'd first play around with them on a stupid simple level

fading bramble
#

so thats why I know only what do they do but I cant imagine them in use

stable urchin
#

@fading bramble make me a modulescript that returns a function that takes in two arguments and sums them up

#

so that I can use it as follows

#
local SumNumbers = require(script.SumNumbers)

local NumberA = 2
local NumberB = 3
local Result = SumNumbers(NumberA, NumberB)

print(Result)
fading bramble
#

yeah I understand them on stupid simple examples

stable urchin
#

taking a guess that you should play around with them first to get a better feel for when to use them

#

hm okay

fading bramble
#

but this one is so not helpful

stable urchin
#

true.

fading bramble
#

cuz u could just do numberA + numberB

#

I came here to get some like still simple but examples where it really is helpful

stable urchin
#

one example is game configuration

#

in our game we have a central config module

#

with config submodules for specific features like settings and keybinds

#

that way we keep each module's size reasonable

#

for example SettingsConfig is 280 lines long and MapDataList is like 200

#

that adds up fast if you keep it all in a single (module)script

#

for the rest I don't have simple examples in mind, thinking

stable urchin
#

it's useful for custom objects/features

#

like simulated springs or projectile systems

#

spring modules are insanely useful

#

and they're obvious cases where you really wouldn't put their code directly in normal scripts since that goes against the Don't Repeat Yourself principle

fading bramble
#

idk I think im too dumb for it

#

maybe id learn on an example where I see the code and it actually is really helpful

stable urchin
#

you just have to sit down and actually research

#

read articles, watch videos that explain the subject

#

read code that others have written, try to dissect and understand it

#

and in the meantime try to apply it

#

that's how you learn

fading bramble
#

yeah I think that my way of learning is seeing and understanding examples that are simple but not useless at the same time

stable urchin
#

at least the euler sim variant

#

they're also used often

fading bramble
#

do u maybe have a yt videos on it?

stable urchin
# fading bramble do u maybe have a yt videos on it?

nothing good after a very cursory search. Came across this though.

searched for

roblox what are code springs tutorial

got this as result https://devforum.roblox.com/t/coding-a-physics-based-spring/2016778

#

looks solid to me

#

there's also this article that took me many reads to digest lol https://www.ryanjuckett.com/damped-springs/

#

springs turn up in animation and a lot in physics like character controllers and car suspension

fading bramble
#
spring.__index = spring

function spring.new(target: any)
    local self = {}
    
    self.Target = target
    self.Position = target
    self.Velocity = 0
    
    self.Tension = .025
    self.Dampening = .3
    
    return setmetatable(self, spring)
end

function spring:Update()
end

function spring:Impulse(num: number)
end

return spring``` why are they doing like .new :Update etc?
#

is it required or what?

stable urchin
#

the idea is that you have a spring module with which you can create individual spring objects

fading bramble
#

yeah I know what OOP is

stable urchin
#

:Update() is to step the spring simulation

fading bramble
#

I know python and a bit of java

#

but is it like required or what

stable urchin
#

yes

fading bramble
#

cuz I dont get why they wont just name it update or impulse

stable urchin
#

if there is no update mechanism

#

then the spring doesn't do shit

fading bramble
#

but I mean the name

stable urchin
#

if you take the simulation out of a spring simulation then there's nothing

stable urchin
fading bramble
#

why do they name it spring:Update() and not just update

stable urchin
#

personal preference

fading bramble
#

so u could do just: function update

#

right?

stable urchin
#

they likely wanted to contrast the constructor method by making it lowercase

stable urchin
fading bramble
#

no i dont mean is it uppercase or lower case

#

why they add spring: and brackets at the end

stable urchin
#

you mean why 'spring' is in the definition?

fading bramble
#

yeah

stable urchin
#

that's to make the function part of the table

#

and by using colon, the first argument is stripped and put in the local variable self

#

to try to paint a picture

fading bramble
#

why its function spring:Update() end and not function update end

stable urchin
#

the following are identical Part:Destroy() Part.Destroy(Part)

#

what is implied is that when you call a method via a table with colon (:), you also feed a reference of the table you accessed the method through

#

and by defining the method with colon, you automatically strip this first argument

#

writing a little demo

fading bramble
#

so to add a function to the table u have to use name. or name: ?

stable urchin
#

updated:

#

as you can see, we called MyFunction via MyTable using colon notation

#

so MyTable is automatically inserted as first argument

#

by defining the method with colon, we get the following

#

it becomes apparent that the first argument is automatically stripped

#

however, it's not gone; it's been put in the local variable self

fading bramble
#

oh so when u use . that means that the function will run itself?

stable urchin
#

and if we call with dot notation:

#

we get the following wacky result

#

as the definition with colon doesn't care what the actual first argument is

#

it just strips the first argument and puts it in self

stable urchin
#

no recursion involved

#

no matter the access method used, the function is executed

fading bramble
#

then why it was 2 hello and not 1 hello if the function was executed once

stable urchin
#

I recommend you play around with the code

#
local MyTable = {}
function MyTable:MyFunction(...)
    print("Reference to self:", self)
    for i, Argument in {...} do
        print(i, Argument)
    end
end

MyTable.MyFunction("Hello!")
#

that's how things become clear for me most of the time, anyway

fading bramble
#

it prints nothing

terse vector
#

Also, to create new objects using ^ system, I like to create an empty table and then set the meta table

stable urchin
#

the snippet I just sent?

fading bramble
#

the one u sent npw

#

yeah

stable urchin
#

it definitly ran for me. Show the output

fading bramble
terse vector
#
Item.new = function(self) 
  local new = {}
  setmetatable(new, self)

  return new
end
stable urchin
fading bramble
#

oh so u also used a script to call it?

stable urchin
#

because that error is completely unrelated to my code

fading bramble
#

yeah ik

stable urchin
#

what

#

did you put it in a module

fading bramble
#

yeah

stable urchin
#

I didn't tell you to

#

it's just a little snippet to explain this auto insertion magic

fading bramble
#

but why it doesnt work

stable urchin
#

put it in a regular script

fading bramble
#

oh ok

stable urchin
#

anyway circling back

#

modules are very good for organizing code

#

you just have to see it in action to believe

true forge
#

Hey guys, I want to share this piece of mine, to get some feedback, maybe I can improve some area, the idea was simple, made a command recognition system, the length of the commands should be 5 letters no more, not less. I am just starting so this was a little project

stable urchin
#

that's a tall order

#

programming is a time sink

nocturne barn
#

why isnt my code working

#

chatgpt isnt working

stable urchin
tame dragon
#

how to code

sturdy fiber
#

So how can i make color blocks in the air fall but the color the gui picks randomly stays up kinda like color switch.

austere solstice
#

yall what am i doing wrong, it looks like whoever gets ragdolled has a seizure and they can still move and stuff whcih they shoudnt: local Ragdoll = {}

function Ragdoll.RagdollCharacter(character, duration)
if not character or not character:FindFirstChild("Humanoid") then return end

local humanoid = character:FindFirstChild("Humanoid")
humanoid:ChangeState(Enum.HumanoidStateType.Physics) -- Enable ragdoll physics

-- Disable Motor6Ds to allow free limb movement
for _, joint in ipairs(character:GetDescendants()) do
    if joint:IsA("Motor6D") then
        local attachment1 = Instance.new("Attachment")
        attachment1.Parent = joint.Part1

        local attachment2 = Instance.new("Attachment")
        attachment2.Parent = joint.Part0

        local ballSocket = Instance.new("BallSocketConstraint")
        ballSocket.Attachment0 = attachment1
        ballSocket.Attachment1 = attachment2
        ballSocket.Parent = joint.Part1

        joint.Enabled = false
    end
end

-- **Automatically unragdoll after the provided duration**
if duration then
    task.delay(duration, function()
        Ragdoll.UnRagdollCharacter(character)
    end)
end

end

function Ragdoll.UnRagdollCharacter(character)
if not character or not character:FindFirstChild("Humanoid") then return end

local humanoid = character:FindFirstChild("Humanoid")
humanoid:ChangeState(Enum.HumanoidStateType.GettingUp) -- Revert back to normal movement

-- Re-enable Motor6D joints
for _, joint in ipairs(character:GetDescendants()) do
    if joint:IsA("Motor6D") then
        joint.Enabled = true
    end
end

-- Remove BallSocketConstraints
for _, constraint in ipairs(character:GetDescendants()) do
    if constraint:IsA("BallSocketConstraint") then
        constraint:Destroy()
    end
end

end

return Ragdoll

somber vault
#

I'm tryna loop through some image labels and connect a click event to them, but nothing came from the output when i put a print statement in the event. Any clue on why?

`for _, miniSlot in ipairs(scrolling_Frame:GetDescendants()) do

if miniSlot:IsA("ImageButton") then
    
    local weapon = gears:FindFirstChild(miniSlot.Name, true)

    local function on_Click()

        tool_tip.Text = miniSlot.Name
        gear_Name.Text = miniSlot.Name
        gear_Icon.Image = miniSlot.Image
        typeName.Text = weapon:GetAttribute("Type")
        tool_tip.Visible = true
        gear_Name.Visible = true
        
    end
    miniSlot.MouseButton1Click:Connect(on_Click)
    
end

end`

bleak delta
#

can someone tell me what i did wrong?

unkempt rain
bleak delta
unkempt rain
icy dew
bleak delta
#

anyone can help?

somber vault
tidal steppe
#

how do i detect if a player is in roblox studio when they join like is it a thing

icy dew
#

RunService:IsStudio()

tidal steppe
#

thanks

icy dew
#

Np

sage vortex
heady spire
#

hi im a beginner to scripting and looking to learn more in the upcoming months, i looked at some of the stuff in the news channel about new studio things like that input system and the ui style thing, are they really efficient and worth finding resources to learn or is it fine to learn like the 'old' way for input from videos/books already out n stuff

tidal steppe
#

to learn

heady spire
#

yea that's what i been doing but im mainly asking about like is the new studio stuff really like pivotal

astral mauve
#

Wanting to learn lua as summer vacation from school started any recommendations where I should learn from?

heady spire
#

like that input system thing i saw in the news channel looks like it would be useful but i jus wanna know if it really is

bleak delta
#

can someone help with the clone error

icy dew
tidal steppe
#

luau is case sensitive

#

parent doesnt work but Parent does

icy dew
heady spire
icy dew
#

No problem

tidal steppe
#

alright i havent done stuff like this before what didi do wrong

#

waitforchild on what

icy dew
spice sedge
tidal steppe
spice sedge
spice sedge
#

basically remote events: oneway, remote functions: twoway (one sends request and waits for reply)

bleak delta
tidal steppe
naive stirrup
#

im a Fivem script developer but wanting to get into roblox script development, where should I start to know wtf im doing? I have experience with LUA in fivem, just not roblox

naive stirrup
#

like for example if i wanna make some particle effects appear on the player when they spawn in etc.

#

good to hear

spice sedge
naive stirrup
#

event of player spawning
for things like this, where can i find what the event is?

#

api doc?

spice sedge
naive stirrup
#
local Players = game:GetService("Players")

Players.PlayerAdded:Connect(function(player)
    print(player.Name .. " joined the game!")
end)

spice sedge
naive stirrup
#

Is there any place that i can do practice work on? like asks me what to do but also provides answer

#

kinda code academy

#
local Players = game:GetService("Players")

local function onCharacterAdded(character)
    print(character.Name .. " has spawned")
end

local function onCharacterRemoving(character)
    print(character.Name .. " is despawning")
end

local function onPlayerAdded(player)
    player.CharacterAdded:Connect(onCharacterAdded)
    player.CharacterRemoving:Connect(onCharacterRemoving)
end

Players.PlayerAdded:Connect(onPlayerAdded)
#

got you

tidal steppe
# bleak delta

ok that is really messy heres the fix

line 4: for i, v in ipairs(script.PlayerValues:GetChildren() do

replace line 5 with whatever you were doing i have no idea 😭

other than that its fine

bleak delta
#

thats what i have

barren lagoon
#

What is the difference between global and local functions

placid ember
#

Wanting to learn LuaU but I have no clue what’s the best way to grow. I know I need to practice, however, are there any ways you guys would recommend going about it?

bleak delta
#

dont work

mellow notch
#

How do i apply to become a hirable scripter

placid ember
mellow notch
#

Where do i find that

carmine zealot
#

@everyone Looking to hire one builder for new project I'm making DM if interested. Will be wage spilt.

placid ember
mellow notch
mellow notch
#

Idk what youre trying to accomplish

copper apex
#

What i did was recreate the small systems of a big game

#

So maybe a game I liked had a cool door clearance system, maybe the door had an animation that I liked, then I would just recreate that

placid ember
copper apex
#

Yes

placid ember
#

Thank you.

bleak delta
#

can someone help me fix these

mellow notch
mellow notch
#

Open the values folder too

placid ember
#

@little wind bro what was that structure 😭

little wind
#

@bleak delta ```lua
local Players = game:GetService("Players")

Players.PlayerAdded:Connect(function(player)
-- Assuming you have a folder named "PlayerValues" under this script
local valuesFolder = script:FindFirstChild("PlayerValues")
if valuesFolder then
for _, value in pairs(valuesFolder:GetChildren()) do
local clone = value:Clone()
clone.Parent = player
end
else
warn("PlayerValues folder not found in script.")
end
end)

little wind
placid ember
#

Wanting to learn LuaU but I have no clue what’s the best way to grow. I know I need to practice, however, are there any ways you guys would recommend going about it? Are courses worth purchasing?

little wind
#

Wanted to copy text from picture but that function needs some work

barren lagoon
#

What is the difference between global and local functions

little wind
bleak delta
#

can anyone help?

little wind
bleak delta
little wind
#

Show me the line that starts like this local Events =

bleak delta
little wind
bleak delta
#

oh

bleak delta
little wind
bleak delta
#

uhh

#

they not scripts right

little wind
#

You wrote Events.ClickAttack but Clickattack is a script do Events.clickattack

wind wharf
little wind
little wind
bleak delta
little wind
little wind
# bleak delta wdym there

You wrote ClickAttack with uppercase C thats what you named you local script and you cant fire a localscript

#

See

bleak delta
#

clean console😁ty

little wind
bleak delta
little wind
bleak delta
summer scarab
spark willow
#

do you guys know of any way to add your own function/method descriptions like the ones that pop up when you try to use one built into roblox?

#

on vs code

#

nevermind

#

found out luau language server supports documentation comments I can just use their formatting to do it

idle rain
#

we can't use clickdectors inside of character? its not letting my click a object with clickdector parented to my character

bleak delta
summer scarab
#

I think it only works in parts

idle rain
placid ember
#

is this peak?!

print(addition)

if addition == 50 then do
        print("Holy shit, 25+25 = 50")
    end
end```
barren lagoon
#

What is the difference between global and local functions

#

And make it simple please

wind wharf
#

Local functions can only be used in that script as per my understanding

frail yarrow
#

You manage to be wrong

#

global functions are globals,
local functions are locals

#

same rules apply

crisp steppe
#

who here knows OOP looking for comm work dm me

idle rain
#

mouse.Target ignores player's character and its decendants by default?

proven depot
#

guys for applying scripter role is it possible to add like few scripts in the pastebin ?

bleak delta
#

can anyone help me play my animations im using script tho and its not working

lean ocean
#

im dead

median tiger
#

Global functions can only be used in the script it’s defined at

#

Ohhh it’s G

#

Nvm

#

_G shouldn’t be used anyways

native sail
#

@median tigerdms?

glacial juniper
#

how much would it be to hire someone to optimize code for a game?

somber vault
hoary cedar
serene fjord
#

Guys i need a scripter for a full game good pay is involved and its a simple week or two long project DM me or reply below if intrested.

crude crater
#
local function castMouse()
    local mouseLocation = UserInputService:GetMouseLocation()
    local ray = camera:ViewportPointToRay(mouseLocation.X, mouseLocation.Y)    
    return workspace:Raycast(ray.Origin, ray.Direction * 1000)
end

or

game:GetService("Players").LocalPlayer:GetMouse().Hit.Position

I was following a tutorial on grid placement and studied the function the tutorial built and found out it's just the same as getting the player's mouse as when I print both, I get the same output. Are these any different?

hallow crag
crude crater
#

now I understand, thanks

fair hazel
#

Anyone here wanna make a game with me

#

im trying to speedrun a game

little wind
fair hazel
#

as a yt video for my channel

ocean plaza
#

what's the fastest way to learn new concepts is it tutorials or dev forum or docs or..?

crude crater
#

thats what I do

#

sometimes I also use ai to explain certain things I don't understand

ocean plaza
#

I've tried every one of those I just don't know what is the most efficient

crude crater
#

idk any other ways to learn efficiently without using all of the sources mentioned

#

maybe just play with the stuff you learned

ocean plaza
#

just tell me one that helped you the most

crude crater
ocean plaza
crude crater
#

docs/devforum is the best if u learn better by reading
tutorials if you're lazy to read

fair onyx
#

yo

somber vault
# barren lagoon And make it simple please
do
    function x()
        return 0
    end
    local function y()
        return 1
    end
end

print(x()) -- this print 0, because global vars do not have the concept of scope
print(y()) -- this errors, because y doesnt exist after the do end scope
spiral jungle
somber vault
#

it is still the same concept

spiral jungle
#

I’m gonna hack you with a gun

somber vault
#

also if you really wanna nitpick

#

globals are stored on the heap = slower lookup. locals are stored on stack therefore faster

#

only advantage globals has is lack of scope but you can have local upvalues and itll achieve about the same thing

spiral jungle
#

Whats up dog

white nova
#

how to make moving part that cant collide with anything move smoothly

spiral jungle
white nova
#

;poop @spiral jungle

lapis hazel
#

Looking for animators / modeler & builder / interface maker / scripters who can take % of robux made from the game ( can discuss the % )

lapis hazel
#

lol

hearty trellis
#

So is it the line “print(TablePlayerRemoving)” that’s messing up for you?

proven depot
#

anyone know how to make a path like this

somber vault
#

Guys I am wondering if anyone could help me learn how to code a bit dm me if ur interested!

mint cloud
somber vault
#

Guys how can I code a fireworks physics so it act like this where gravitiy slows it down?

ancient urchin
somber vault
#

I am not a coder I do UI I amm trying to learn

#

Its going not great ngl

somber vault
#

ohh

#

Is vector 3 the Y axis?

ancient urchin
#

Vector 3 has three coordinates x,y and z
Here y is the height

somber vault
#

Okay so it would go (x, y, z)?

ancient urchin
#

yea

somber vault
#

Okay so First I need to get the current postion of the part

#

How do I do that?

#

Do I take the pos and make it a variable?

ancient urchin
#
local part = workspace.Part
local pos = part.Position
somber vault
#

Okay

#

So now should I make it print(pos)?

ancient urchin
somber vault
#

I want to learn

#

not copy

ancient urchin
#

it teaches you

#

The guy in the video is explaining it very well

#

probably better than me

somber vault
#

Wait so if I have pos how would I make it so that it add 100 to the y? would I grabe pos and add like a string?

#

pos.Y += 100?

ancient urchin
ancient urchin
somber vault
#

huh

#

How come?

ancient urchin
#

protected field of the class

somber vault
#

hm

ancient urchin
somber vault
#

ty

#

im poor...

somber vault
round mist
#

i think i put this in wrong channel

#

troll

obtuse roost
nova yarrow
#

Vdjbrqp

placid peak
#

heya guys im a new scripter with little to no and learning with online stuff and etc, what do u recommand that i sohuld do like small projects to do for improving my scripts and etc

upper sleet
#

Does anyone know how to apply a shirt to a gun viewmodel the correct way, i am using a humanoid and putting the shirt object inside of the viewmodel. This works but the viewmodel kinda goes crazy when you have a humanoid in it, it flings me. I searched the devforum and they all said make a humanoid to people who were asking. But a humanoid doesn't work for me. I also searched youtube and found like nothing. How do you do this?

empty wind
weak radish
empty wind
weak radish
empty wind
weak radish
#

I just made little projects focusing on raycasts, datastores etc

fluid galleon
copper apex
ivory bronze
#

Anyone here that is a REALLY good scripter but is bored to death rn?

ivory bronze
plain marlin
#

Is using a while true loop every 0.1 second for removing expired Projectiles okay? I’m trying to make it more optimised than task.delay()

trim sierra
trim sierra
#

make it 3d 😈

#

thats where the real fun at gang

#

with air resistance

#

and is interactive to walls

wet holly
#

How can i put effects around someone while using a item ? (like, you press left clcik with an item and it shows some effects around you )

wet holly
#

what is that

trim sierra
#

google

#

learning is on u, telling u is on us

weak radish
ivory bronze
weak radish
ivory bronze
weak radish
ivory bronze
weak radish
#

so

ivory bronze
#

lol

weak radish
#

?

trim sierra
#

😂

weak radish
ivory bronze
trim sierra
#

ofc he wanted "REALLY" good scripters

#

he prolly needs 5++ years of experience for a leaderboard system 😂 😂

ivory bronze
#

god every time i say something in here i get clowned

trim sierra
#

nah its probably 10+

wind wharf
weak radish
trim sierra
#

thats code hlpe for u

weak radish
#

you literally asked for an advanced scripter and made it so obvious you want them to code something for you

ivory bronze
weak radish
#

then deny that was your purpose

trim sierra
ivory bronze
#

i can

trim sierra
#

prove it

weak radish
#

its not exactly surprising or hard

#

but I dont believe you

ivory bronze
trim sierra
#

make it gang

weak radish
#

the script

trim sierra
#

the classic inbuilt leaderstats

#

do that Thumbsup

#
thing
weak radish
#

Yeah no custom ui or anything just plain

trim sierra
trim sierra
weak radish
#

Gone off to chatgpt 😭

ivory bronze
#

bru

weak radish
trim sierra
weak radish
#

its not that deep

weak radish
#

Bro

trim sierra
#

damn hes taking long

weak radish
#

this guy

#

Chatgpt isnt even that slow

trim sierra
#

💔

#

roblos

trim sierra
#

🥀

weak radish
#

oh wait I am but wrong account

#

BRO

#

ROB

#

Game is gone

trim sierra
#

what is bro cooking

#

is he making ui in script 💔

weak radish
#

I mean even that doesnt take this long

#

That would be easy

ivory bronze
#
game:GetService("Players").PlayerAdded:Connect(function(Player)
  local leaderstats = instance.new("Folder")
  leaderstats.Name = "leaderstats"

  local Money = instance.new("IntValue")
  Money.Parent = leaderstats
  Money.Value = 0
  
end)

 ``
trim sierra
ivory bronze
#

god

#

i hate this

weak radish
ivory bronze
bleak glade
weak radish
#

What does local do?

trim sierra
weak radish
trim sierra
#

moron :/

ivory bronze
bleak glade
#

local variables are local to the scope

trim sierra
#

in a server script or smt, why cant i just do
skibidi = 5

#

it just gives a red line

weak radish
trim sierra
#

isnt htat a global scoped?

weak radish
#

And is tryna play it off that its him

ivory bronze
weak radish
ivory bronze
#

creates a variable

trim sierra
#

chatGPT would've parented it

#

he didnt

bleak glade
trim sierra
#
hello = 5
#

this wont work for some reason

#

gives error

weak radish
trim sierra
bleak glade
ivory bronze
trim sierra
trim sierra
bleak glade
#

it shouldnt really have a red underline though to begin with

weak radish
bleak glade
weak radish
trim sierra
weak radish
ivory bronze
bleak glade
#

just use local unless you actually need it global

#

local variables are faster as theyre on the stack

weak radish
trim sierra
#

oh what the fuck

#

it isnt a red line now

#

what the fuckkkkk

#

i did not know that

#

thats so cool

weak radish
#

"This variable is only used in the enclosing function consider using local"?

trim sierra
#
local hello = 5
skibidi = 5

whats the difference @bleak glade

bleak glade
#

like a playeradded scope

trim sierra
#

theyre both global still

weak radish
#

in local

#

pretty much

trim sierra
bleak glade
weak radish
#

Oh wait

#

It doesnt add it to _G I assume

#

Idk I dont use _G

#

and I probably spelt it wrong

bleak glade
little wind
#

hi guys how are you

south roost
#

is anybody able to help and tell me why does attack,knockback delay when i increase stuntime

little wind
little wind
static coral
#

did bro get banned 💔

foggy fiber
#

whats the best way to run/hide animations without exploits stealing it or using anim loggers

somber vault
#

HELP - local part = script.Parent

part.Touched:Connect(function()
humanoid.Health = 0
end)

#

FIX THAT

fluid galleon
nimble hinge
#

is there a place for coding challenges or ways to learn how to code

steady robin
#

and you'll learn

nimble hinge
nimble hinge
steady robin
#

coyp someone else's code

#

and analyze it

#

and you'll learn

nimble hinge
summer oxide
summer oxide
#

u can also just hit me up and i will send you one of my codes

#

to analyze

nimble hinge
summer oxide
#

ye for sure

#

what is your skill level rn?

#

just so i know how advanced the scripts i send should be

nimble hinge
#

not to good tho

summer oxide
#

alright lemme try to find something

#

ima send it over dms

nimble hinge
#

alr ty

young rock
#

How can i hide a proximity prompts background (that half transparent black bg) i know a bit about custom prompts but not really used to them, could anyone help?

fluid galleon
steady robin
#

😭

nimble hinge
snow veldt
weak radish
snow veldt
weak radish
weak radish
#

Apart from the 10 year olds and rage baiters

weak radish
#

Yep, eliminating the issues

#

If they run the code they deserve it

snow veldt
#
part.Touched:Connect(function(hit)
  if hit then
    if hit.Parent then
      if hit.Parent:FindFirstChild("Humanoid") then
       local character = hit.Parent 
       local health = character.Health
       task.wait(2)
       if health !< 100 then
         while task.wait(.1) do
           health -1
           if health < 1 then
             break
           end
         end)
       end
      end
    end
  end
end)```
slate lotus
#

Does anyone know how to get the pfp of someone whos not in the game

#

No with a script

snow veldt
#

idk, it is in javascript so probably

#

wait ~<

weak radish
#

not more than is just less than or equal to

foggy fiber
#

has anyone used the Groove Animator

snow veldt
#

it means not lesser than, i was just trying to make it messy 🙂

#

soo it would loop and then break when its lesser than wtv num i put

weak radish
digital prism
#

If I rename a script, does script.parent still work?

weak radish
snow veldt
#

HM

#

OHH I MEAN ~<

#

woops

snow veldt
weak radish
snow veldt
#

like the script itself

snow veldt
weak radish
#

I just asked chatgpt cus I can't access studio rn

snow veldt
#

i mean in js

#

wait wth nah i just tested

#

idk where the hell i used ~< or !<

weak radish
#

Because it's pointless

snow veldt
#

nahh its not though coz years ago when i was learning, idek if it was c++ or js

weak radish
#

There is literally no use of it

snow veldt
#

i was using it because it was a conenient way of doing something instead of using stuff like ! (a < b)

weak radish
#

bri

#

=

snow veldt
#

OHHHHHHH

#

WAIT NO I DID USE THE js ! ( a < b ) i thinkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk

#

I forgot what i done

#

OH yeah i think i just done >=

weak radish
#

.

crisp steppe
#

who here knows OOP looking for commissioned work everything provided (3-5 days project) dm me

oak solar
#

Yo does anyone know a website where you can buy roblox system and games.

tawny widget
#

what the fuck is the not equal != in lua

#

I dont have the goofy ass serppent in my fucking keyboard

#

the world is so cruel

summer aurora
#

peak coding

odd lantern
#

☠️

vagrant mulch
idle saffron
summer aurora
exotic minnow
tawny widget
exotic minnow
hasty mesa
#

it would create unexpected results

#

and why use buffers and make it overly complicated

buoyant zealot
#

what should i try to make i do t have any ideas 🙏

median tiger
wind wharf
#

havent coded much yet im still learning the basics

median tiger
#

I wasn’t

plain marlin
wind wharf
plain marlin
median tiger
wind wharf
#

security?

median tiger
#

Yuh

plain marlin
median tiger
#

Exploiters

plain marlin
#

Just use modules right

wind wharf
plain marlin
#

Or bindableEvents

median tiger
plain marlin
#

Yh

median tiger
hasty mesa
#

not security

plain marlin
hasty mesa
#

just organization, and you lose intellisense

hasty mesa
median tiger
hasty mesa
#

so are modules

#

and everything else the client has access to

median tiger
#

Myea

frail yarrow
#

All client side code is vulnerable

#

Simple as

royal ibex
summer aurora
exotic minnow
#

You mean the for indec, value loop?

#

Roblox already has this covered

hasty mesa
exotic minnow
#

Yeah but that is vanilla lua

#

not luau

hasty mesa
#

thats luau

exotic minnow
#

Meh I will do for index=1 loop and increment index by the amount it removes

hasty mesa
#

but why are you overcompliating it

#

is this for learning purposes or actual use case

#

cause learning purposes makes sense

#

actual uses case not really

steady robin
exotic minnow
# hasty mesa but why are you overcompliating it

Its not really overcomplicated at all because when you strip it to its concept buffers in that code essentially work as pointers to global array and yes, I could do this by creating arrays with index and state but when there are buffers I dont see the need to use arrays

exotic minnow
hasty mesa
#

you're buffers are only size 2

exotic minnow
#

Yeah

hasty mesa
#

a vector3 would take up less size btw

#

so would a number

#

and you index them to an array either way

steady robin
hasty mesa
#

so at the end you're not saving any

exotic minnow
#

Yes but I need to store two numbers and tables take 40 or 20 bytes

steady robin
#

I don't see the use case

hasty mesa
#

16 + overhead + size

#

a vector3 takes 16

#

a number takes 16

exotic minnow
steady robin
#

Simply store them?

exotic minnow
#

Its in the name

exotic minnow
hasty mesa
#
local Signal = {}
Signal.__index = Signal
Signal.__type = "Signal"
local Connection = {}
Connection.__index = Connection


function Connection.new(Signal, Callback)
    return setmetatable({
        Signal = Signal,
        Callback = Callback
    }, Connection)
end

function Connection.Disconnect(self)
    self.Signal[self] = nil
end
 

function Signal.new()
    return setmetatable({} :: any, Signal)
end

function Signal.Connect(self, Callback)
    local CN = Connection.new(self, Callback)
    self[CN] = true
    return CN
end

function Signal.Once(self, Callback)
    local CN; CN = Connection.new(self, function(...)
        CN:Disconnect()
        Callback(...)
    end)
    self[CN] = true
    return CN
end

function Signal.Wait(self)
    local waitingCoroutine = coroutine.running()
    local cn; cn = self:Connect(function(...)
        cn:Disconnect()
        task.spawn(waitingCoroutine, ...)
    end)
    return coroutine.yield()
end

function Signal.DisconnectAll(self)
    table.clear(self)
end

function Signal.Fire(self, ...)
    if next(self) then
        for CN in self do
            CN.Callback(...)
        end
    end
end

this is an example of a very simple signal, not the best but it would probably take up less size and be more efficent

steady robin
#

?

hasty mesa
#

prefrence

steady robin
#

ic

hasty mesa
#

plus you get to type check it

steady robin
hasty mesa
#

you still utilize an array here

#

so why not directly store the function in the array

exotic minnow
hasty mesa
#

instead of assigning a pointer

exotic minnow
hasty mesa
#

when you disconnect

#

so not sure what you're point at

#

or you could just use a linked list

#

or a hashmap

exotic minnow
#

the whole point of having global table is to reduce the amount of tables, centralize the environment and make it scalable

hasty mesa
exotic minnow
hasty mesa
#

the simple I sent above is a simple impmentation

#

and easy to understand

hasty mesa
steady robin
hasty mesa
#

all primitives data types takes up the same base size

#

you'rs is also limited to 255 events

steady robin
#

in the Signal.Once function

#

because when you look at the Connection constructor

#

it only defines the callback

hasty mesa
steady robin
#

doesn't call it anywhere

exotic minnow
#

I made something I want to be scalable and easily debuggable and mainly centralized because Ive worked on projects and I just dont want to have bunch of tables randomly used in scripts

hasty mesa
#

which is called when Fire is called

steady robin
#

Yeah

#

but what about if the game calls it

#

for example Touched

exotic minnow
hasty mesa
#

and in this case using buffers isn't really benifiting you

#

and making it way more complicated then it needs to be

steady robin
#

What is even the point in this

#

I don't really understand it

hasty mesa
#

for example

steady robin
#

Oh

#

Is that all?

#

So instead of it being a roblox event

#

the script would call Touched

#

and another script could listen to it

hasty mesa
#

well its meaing to create your own events

steady robin
#

Well yeah

hasty mesa
#

like when a custom object gets it's value increased

#

or changed

#

it fires a custom signal

steady robin
#

yeah I understand it now

#

I didn't know what use case was for it

random nebula
#

hi

hasty mesa
#

its overcomplicated and would be less efficent then a normal signal lib is what i'm saying

random nebula
steady robin
#

damn

steady robin
#

Why do you name variables like that

#

and table indexes

#
local signalHandler = {
    CallbackFunctionArray = {},
    AvailableIndexes = {},
    ["#OneTimeLoad"] = true,
    ["#Index"] = "Signals"
}

#

"#Index"

#

I don't really understand why you do that

exotic minnow
steady robin
#

Yeah but why

exotic minnow
#

Its a framework I made for my projects just has some basic dependncy loading with error handling

steady robin
#

👍

exotic minnow
#

This is it

hasty mesa
young rock
#

Guys ive been trying to make a function that gives me a number between x and y but i want the bigger numbers to be rarer to get


local Min = 1
local Max = 4
local Random = math.random() ^ 13
return Min+ Random * (Max - Min)

i tried this and played with the numbers but it either gives a big number or a number so close to the minimum so it feels kinda off
could anyone help by any chance?

random nebula
#

@exotic minnow did you know vector3 is smaller than vector2

#

and like 4x faster

hasty mesa
buoyant zealot
#

i know the basics of coding but like whenever i try to make something my mind just goes blank 🙏

exotic minnow
#

I don't agree that my structure is not scalable and I will stand by buffers being suited for this as I might be dealing with hundreds of connections and in this scenario I cannot give a fuck about absolute simplicity of the code

hasty mesa
#

the problem is efficiency

#

if you care about speed this isn't better then table

#

or better in the sense of memory

random nebula
#

buffers will not be faster until u exceed the cache size

steady robin
#

SETTABLE is faster than CALL

random nebula
#

which is like 4k+

hasty mesa
#

but its still slower lmao

steady robin
#

well yeah

hasty mesa
#

unless you have native

steady robin
#

SETTABLE is faster

exotic minnow
hasty mesa
#

which means its not

random nebula
#

bro i guarentee you will not have 4k signal connecitons and if you do ur code is just ass

hasty mesa
fading bramble
#

how to set a model orientation cuz the docs say that method 1 is deprecated and I should use method 2 but method 2 is also deprecated and it says to use method 1

fading bramble
#

but I need to bro

steady robin
#

ask chatgpt