#code-discussion
1 messages · Page 84 of 1
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
I know i should usse AdjustSpeed((-1) but im not sure how exactly
call it on the animationtrack
track:Play() ; track:AdjustSpeed(-1)
-- i need to anim play backwards at this moment
``` wont do it
if it looks bad in any way, please make a recording of it and share
looks correct? I'd put the adjustspeed call on a new line though, and not use semi colons since they're completely unnecessary in Luau
this wont go then
cuz the animation just started playing
it will go back to 0 cuz of the reverse
and will stop
this wont work then tho ;-;
cuz it will never stop
i tried it with a while loop
but still looks weird
when should it stop then
did you specify fadetime to be 0 when you tried with a while loop
if i set the looped property on then never
when should? it stop?
never, i want to loop it
but loop it smoothly
thats why it should play backwards when stopped
I read this and thought I was seeing things
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?
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
use Color3.fromRGB
cant find the problem, can someone help?
Ur laser sword don’t exist
it does, i have it as a tool
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
u can only adjust the speed while the animation is playing, so detect when its playing and adjust the speed
doesn't fix the problem
I mean you could have it only render within a radius
Are you sure? Send the new script
What happened to the singular line 😭
Use for loops bro
?
chat has AI crashed out?
oh my bad
you're another dude lmao
the code I posted isn't relevant for what you had in mind
FYI I didn't write that
I just edited it and commented out UI code since I didn't have the UI locally
I mean it's not innefficient code its just using more lines than you need for something like that
What happened with the colour one then
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
guys who wants to collaborate? i am making a game i need scripters . For who wants ….write me in private!
any scripters that wanna be hired?
yeah
I reckon they wanted to maintain UI references
I'd also personally use contextactionservice
but those aren't the problem in this case
Oncharacter added is everytime the script is run
Does it say it's player?
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
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
Yeah exactly that's why I was conffused
can you show the instance hierarchy and perhaps send the character here as .rbxm model file
already did it for you
wsp found out you took down the commission once I sent you the code and you never responded/payed me
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
Nah it was BodyColors taking over I'm dumb
ayo
nice
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 ?
just put the rig character you want in starter player and name it "StarterCharacter"
Im new to lua i know c#,python, js and html and i want some help in lerning can someone help me te learn?
I'm starting to learn coding but I have a question
What's the difference between
for loops and
while loops
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?
for loops execute a certain amout of time, and a while loop runs until a condition is met
if you change a value with a local scripts, can other local scripts from the same player see the changed value?
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
]]
ooh thanks
guys give me some complex tasks i can ask the premium AI to do, i wanna know how smart he is
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.
wtf
Makes sense
Prove the Riemann Hypothesis
The short answer is that no proof of the Riemann Hypothesis is known: it remains one of the great open problems in mathematics.
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.
yo who tryna work for me
how well he did?
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.
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 )
autonomous turrets can get very complex
you can sink a lot of time into them
something I worked on for a little while, mostly finished now https://www.youtube.com/watch?v=Q25R_MGN8qA
nifty features like lead prediction accounting for projectile gravity and target acceleration, firing in bursts for accuracy, working with any orientation of turret
you could also make a car system. You have a lot of control over how detailed you want to make your sim
apply to lockheed martin, put this in your resume
my father joked about that aswell
It's quite impressive, good work
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
you could also make a character movement system. This forces you to deal with user input, physics and making it feel good.
Ive realized that I never used module scripts in my game, can anyone give me an example when would u use it?
features like mantling, wallrunning, bars that you can grab and swing with
that is cool idea
what do you know about modulescripts?
before I start over explaining
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
very basic typa grow a garden offline growing
in the case of the game me and my friend are working on, everything
the main categories of usage, for me, are configuration and grouping a body of code that has one main goal
so we have various 'services', basically gameplay elements, on the server
could u show me like one of the scripts and the normal script where u use the module one?
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
well very easy like when u want to make something fly and do some particles like do the same thing multiple times, insted of placing the same code in multiple scripts u can put that code in a module script and then call the module script from a server script or a local script so it makes everything easier
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
why not keep it in a single script?
it gets very messy very fast
especially so with the structured script pattern I use
then why module scripts and not normal scripts?
if you have 15 different loosely related functions it becomes a PITA to navigate
grouping related code
and with normal scripts you can't delegate related code
anyone got any reccomendations for learning scripting? ive just been watching thedevkings tutorials and doing the scripts in RS while taking notes
here's an example. There's quite a lot of turret AI code. Keeping that around in the main Turret environment would make it very messy
im a complete beginner btw
@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
Idk I think this one is a too complicated example...
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
is there anything you're working on right now
so that I can familiarize you on how to chop up code and seperate it into various modules
nope that why I was asking for the ideas for learning
but I realized that maybe ill finally learn module scripts
nope never in my life
ah
I only watched a tutorial on module scripts when I was learning scripting
but I never really touched them
honestly I'd first play around with them on a stupid simple level
so thats why I know only what do they do but I cant imagine them in use
@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)
yeah I understand them on stupid simple examples
taking a guess that you should play around with them first to get a better feel for when to use them
hm okay
but this one is so not helpful
true.
cuz u could just do numberA + numberB
I came here to get some like still simple but examples where it really is helpful
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
oh something popped up in my head
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
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
for springs? nah
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
yeah I think that my way of learning is seeing and understanding examples that are simple but not useless at the same time
springs are relatively simple
at least the euler sim variant
they're also used often
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
Introduction Hello there! In this forum post, I’ll show you the inner workings of a physics-based spring and how to make your own! But hold on, what are the uses of such a thing? For example, FPS games use springs for gun recoil, sway, walk cycle, and much more. And there are a ton more use-cases that extend beyond FPS games. The base code...
looks solid to me
there's also this article that took me many reads to digest lol https://www.ryanjuckett.com/damped-springs/
I've worked on third-person camera systems for numerous games and I often need a method for smoothing camera motion as the player moves through the world. The player’s motion may create sharp, discontinuous changes in direction, speed or even position. The camera, however, should:Avoid discontinuities in motion. Accelerate and decelerate as ne...
springs turn up in animation and a lot in physics like character controllers and car suspension
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?
this module tries to mimic OOP
the idea is that you have a spring module with which you can create individual spring objects
yeah I know what OOP is
:Update() is to step the spring simulation
yes
cuz I dont get why they wont just name it update or impulse
but I mean the name
if you take the simulation out of a spring simulation then there's nothing
you mean why it's uppercase?
why do they name it spring:Update() and not just update
personal preference
they likely wanted to contrast the constructor method by making it lowercase
function spring:update() yes
no i dont mean is it uppercase or lower case
why they add spring: and brackets at the end
you mean why 'spring' is in the definition?
yeah
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
why its function spring:Update() end and not function update end
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
so to add a function to the table u have to use name. or name: ?
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
oh so when u use . that means that the function will run itself?
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
not at all
no recursion involved
no matter the access method used, the function is executed
then why it was 2 hello and not 1 hello if the function was executed once
because as I explained earlier if you call the function through the table using colon notation, the table through which you call said function will be inserted as first argument
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
it prints nothing
Also, to create new objects using ^ system, I like to create an empty table and then set the meta table
Item.new = function(self)
local new = {}
setmetatable(new, self)
return new
end
how and where are you running the script
oh so u also used a script to call it?
because that error is completely unrelated to my code
yeah ik
yeah
I didn't tell you to
it's just a little snippet to explain this auto insertion magic
but why it doesnt work
put it in a regular script
oh ok
anyway circling back
modules are very good for organizing code
you just have to see it in action to believe
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
gyat ge pe te does a better job
how to code
So how can i make color blocks in the air fall but the color the gui picks randomly stays up kinda like color switch.
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
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`
can someone tell me what i did wrong?
then
error still comes up
is the ClickAttackDebounces[Player] a function? because if it is, you need to put () at the end
Remove line 44
are you supposed to capitalize C for clone
how do i detect if a player is in roblox studio when they join like is it a thing
RunService:IsStudio()
thanks
Np
Dms
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
i learned basics from videos then i used studio documentation
to learn
yea that's what i been doing but im mainly asking about like is the new studio stuff really like pivotal
Wanting to learn lua as summer vacation from school started any recommendations where I should learn from?
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
can someone help with the clone error
The updates are useful but I wouldn’t call them pivotal. They don’t really change much, if anything, about the scripting learning process
capital Parent
luau is case sensitive
parent doesnt work but Parent does
And even if you learn the “old” ways you’ll understand why the new ways are better and they’ll be super easy to learn
i see thanks a lot for the help appreciate it
No problem
alright i havent done stuff like this before what didi do wrong
waitforchild on what
When you send a remote event the server doesnt automatically return something. You would have to do a :FireClient back in order to get the data
do i fireclient true?
firing a remote doesn't return anything, are you sure you want to use RemotEvents and not RemoteFunctions?
whats the difference between them should i use the function
RemoteFunction can return something, string, number,... check the documentation
ok ill use that
here's a better explanation by the way
basically remote events: oneway, remote functions: twoway (one sends request and waits for reply)
did not work
show the script also dont you need an index for the loop
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
start with the documentation
like for example if i wanna make some particle effects appear on the player when they spawn in etc.
good to hear
you need to create an ParticleEffect instance and connect it to an event of player spawning
event of player spawning
for things like this, where can i find what the event is?
api doc?
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(player)
print(player.Name .. " joined the game!")
end)
that's for player joining, you want to use the character event instead
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
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
thats what i have
What is the difference between global and local functions
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?
dont work
How do i apply to become a hirable scripter
HD website
Where do i find that
@everyone Looking to hire one builder for new project I'm making DM if interested. Will be wage spilt.
We're a community of skilled creators. From programmers to graphic designers - we provide a platform to communicate, share, and transact amongst other fellow creators.
PlayerValues is a number not an instance so its erroring because you cant clone a value
stfu😭
Idk what youre trying to accomplish
If you know the basics, so data types, syntax, for loops, conditional statements, tables ( arrays and dictionaries ), etc, then this is the part where you just practice making things
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
so how do i fix it
smart, thank you man
Just look at YouTube/DevForum for the basics?
Yes
Thank you.
can someone help me fix these
What does the playervalues folder or whatever it is look like in your explorer
Open the values folder too
Is it worth getting a course?
@little wind bro what was that structure 😭
@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)
Dont worry abt that lol
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?
Wanted to copy text from picture but that function needs some work
What is the difference between global and local functions
it worked tysm
Np
can anyone help?
How many you got lol
thats my last one till i start following the vid again
What is event
Show me the line that starts like this local Events =
^^^
This is a diffrent script
oh
what thing is it?
...
You wrote Events.ClickAttack but Clickattack is a script do Events.clickattack
global functions can be used outside of where the script is defined - basically local is easier and better for avoiding unintended bugs thats how i see it
where do i put it
Here
wdym there
You wrote ClickAttack with uppercase C thats what you named you local script and you cant fire a localscript
See
clean console😁ty
Np
wait do yk how to fix why my animations not working?
Maybe maybe not i dont do animations
all i put was scripts for my animation so idk
Capitalize the S in FireServer
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
we can't use clickdectors inside of character? its not letting my click a object with clickdector parented to my character
i fixed it alr
Try putting the ClickDetector in the root part
I think it only works in parts
i have it in a meshpart
is this peak?!
print(addition)
if addition == 50 then do
print("Holy shit, 25+25 = 50")
end
end```
What is the difference between global and local functions
And make it simple please
global functions can be used outside of where the script is defined - basically local is easier and better for avoiding unintended bugs thats how i see it
Local functions can only be used in that script as per my understanding
You manage to be wrong
global functions are globals,
local functions are locals
same rules apply
who here knows OOP looking for comm work dm me
mouse.Target ignores player's character and its decendants by default?
guys for applying scripter role is it possible to add like few scripts in the pastebin ?
can anyone help me play my animations im using script tho and its not working
script ?
do end
Capitalize the 2
im dead
absolute peak
No
Global functions can only be used in the script it’s defined at
Ohhh it’s G
Nvm
_G shouldn’t be used anyways
@median tigerdms?
WTD BRO
trach me
how much would it be to hire someone to optimize code for a game?
https://www.roblox.com/games/140206023294551/Mega-Stud-Jump tell me if there are any bugs in my game?
Depends on how bad the game is running, and the workability of the codebase
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.
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?
use GetMouse().Hit.Position for pc/console players and raycast for mobile
now I understand, thanks
Poor guy
as a yt video for my channel
what's the fastest way to learn new concepts is it tutorials or dev forum or docs or..?
try finishing a tutorial, understand why the tutorial did what it did, use the docs/dev forum for more clarity
thats what I do
sometimes I also use ai to explain certain things I don't understand
yeah I know they're all good sources but if you could mention one that you find the best help with excluding AI I would appreciate that
I've tried every one of those I just don't know what is the most efficient
idk any other ways to learn efficiently without using all of the sources mentioned
maybe just play with the stuff you learned
just tell me one that helped you the most
trying to copy mechanics from different games
but like if you get stuck and don't know how to finish the mechanic, one source that helped you understand what you need to do the most, only one, so I know the best one to use
docs/devforum is the best if u learn better by reading
tutorials if you're lazy to read
yo
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
He’s talking about functions not variable scope
it is still the same concept
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
Whats up dog
how to make moving part that cant collide with anything move smoothly
By moving it smoothly
;poop @spiral jungle
Looking for animators / modeler & builder / interface maker / scripters who can take % of robux made from the game ( can discuss the % )
lol
So is it the line “print(TablePlayerRemoving)” that’s messing up for you?
Guys I am wondering if anyone could help me learn how to code a bit dm me if ur interested!
In Roblox? Pathfinding has a parameter that tells agent how much it “likes” a certain material , so you can use that to refine the path
oh ok thanks!
Guys how can I code a fireworks physics so it act like this where gravitiy slows it down?
You can just make an part and give it impulse
how da hell
I am not a coder I do UI I amm trying to learn
Its going not great ngl
Vector 3 has three coordinates x,y and z
Here y is the height
Okay so it would go (x, y, z)?
yea
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?
local part = workspace.Part
local pos = part.Position
Discord: https://discord.gg/bEn49K5JUt
Patreon: https://www.patreon.com/Suphi
Donate: https://www.roblox.com/games/7532473490
ApplyImpulse: https://create.roblox.com/docs/reference/engine/classes/BasePart#ApplyImpulse
0:00:00 - Intro
0:00:33 - Create Project
0:01:29 - Script
0:08:18 - Projectile Duration
0:14:24 - Target Velocity
0:17:40 - Outro
it teaches you
The guy in the video is explaining it very well
probably better than me
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?
you can't
hm
#tutors )
use tweening
yeah this too work, if you want to simulate real physics
Anyone know a yt tutorial video for this? #staff-help message
Vdjbrqp
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
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?
join some collabs for experience but PLEASE mention that you're a new scripter or you'll be given some crazy tasks
I mean if he's that new it's probs better doing personal projects
it's hard to do a personal project for a new scripter i mean if they aren't primitive as hell
That's the only way I got good and I'd consider myself quite experienced
well it depends on the difficulty of a project
I just made little projects focusing on raycasts, datastores etc
if you part is unanchored roblox physics already does that you just need to apply a initial vel of 200mph( ?? maybe stud/sec) at start
For new scripters they tend to try to create games, hence its difficult, i advice new scripters to do smaller projects
Anyone here that is a REALLY good scripter but is bored to death rn?
what?
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()
u could technically use all of newtons laws of motions 💀 and forcecode it
whats up with projectiles damn
make it 3d 😈
thats where the real fun at gang
with air resistance
and is interactive to walls
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 )
vfx
what is that
Anyone here that goes by the name rob_z707 that thinks theyre tons of advanced scripters who work for free
did i mention anything about hiring someone?
Why do you want them
i just wanted to start a convo
About?
idk
lol
?
real
caught in what dude
ofc he wanted "REALLY" good scripters
he prolly needs 5++ years of experience for a leaderboard system 😂 😂
god every time i say something in here i get clowned
nah its probably 10+
yeah
Was I right though?
I wonder why
thats code hlpe for u
you literally asked for an advanced scripter and made it so obvious you want them to code something for you
i can make that on my own
then deny that was your purpose
no u cant 🔥
i can
prove it
Say it here
its not exactly surprising or hard
but I dont believe you
say how i would make it?
make it gang
Yeah no custom ui or anything just plain
just say inbuilt
Gone off to chatgpt 😭
Yeah but hes gonna ask chatgpt and its gonna come up with custom stuff
--here
ill know
Bro
damn hes taking long
Not signed in
oh wait I am but wrong account
BRO
ROB
Game is gone
Real
I mean even that doesnt take this long
That would be easy
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)
``
it would if hes adding designs
Yeah but I mean for the functionality
what does local do?
bro what
defines a local variable
What does local do?
u forgot too parent the leaderstats
bro ;sob:
moron :/
mb
local variables are local to the scope
yeah btw i have a question for global scopes
in a server script or smt, why cant i just do
skibidi = 5
it just gives a red line
It was a question for him cus hes using chatgpt to code leaderstats
isnt htat a global scoped?
And is tryna play it off that its him
i am not using chat gpt bro
WHat does local do
creates a variable
he didnt use chatGPT
chatGPT would've parented it
he didnt
this may happen if its created without being delcared
wdym?
hello = 5
this wont work for some reason
gives error
I think he tried making it look less ai and accidentally deleted the parent code
he wouldnt, hes not that smart
defined but not used
how can i prove that i am not using ai
oh
you've proven it already dw
it shouldnt really have a red underline though to begin with
BY ANSWERING WHAT "LOCAL" DOES INSTEAD OF DODGING THE QUESTION 5 TIMES 😭
I ANSWERED
it does doe
show your script
So your final answer is "local" creates a variable?
okay 1 sec
yes
bro
idk how i can explain it
just use local unless you actually need it global
local variables are faster as theyre on the stack
Man this guy keeps digging himself a bigger hole
oh what the fuck
it isnt a red line now
what the fuckkkkk
i did not know that
thats so cool
"This variable is only used in the enclosing function consider using local"?
``la
local hello = 5
skibidi = 5
whats the difference @bleak glade
if it was red underlining then it was probably in another scope
like a playeradded scope
if theyre both defined in the first line of the script
theyre both global still
The variable cant be used outside the function
in local
pretty much
what if its not in a function?
skibidi is in a shared environment
pretty sure it doesnt do anything
Oh wait
It doesnt add it to _G I assume
Idk I dont use _G
and I probably spelt it wrong
no
hi guys how are you
is anybody able to help and tell me why does attack,knockback delay when i increase stuntime
Move the attack logic to happen before or during the Stunned time not after
ill try
👍
skibidi is a global which is unoptimized, always use local
did bro get banned 💔
whats the best way to run/hide animations without exploits stealing it or using anim loggers
HELP - local part = script.Parent
part.Touched:Connect(function()
humanoid.Health = 0
end)
FIX THAT
here you go:
script.Parent.Touched:Connect(function(hp)
local char = hp.Parent
local hum = char:FindFirstChild("Humanoid")
if hum then
hum.Health = 0
end
end)
is there a place for coding challenges or ways to learn how to code
What is this
😭
anything specific?
just skid
and you'll learn
not really just trying to learn how to code cause its kidna hard for me to learn off coding tutorials
skid?
ill try that
there is some roblox scripting school games but they are only for people who have like never coded before
oh
yeah could u send me some to analyze
ye for sure
what is your skill level rn?
just so i know how advanced the scripts i send should be
id say kinda intermediate, been scripting for a couple of years on and off but never really got in to it
not to good tho
alr ty
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?
Code
Language: Lua
any other methods u recommend?
local function onTouched(hit)
local character = hit.Parent
local humanoid = character:FindFirstChild("Humanoid")
-- Dealing Damage
if humanoid then
humanoid.Health = 0
end
end
script.Parent.Touched:Connect(onTouched)
This place is so much nicer than #code-help
its rare to actually get help there from what ive seen lolol
Ide want help but there's some rage baiters
here i got u twin
Apart from the 10 year olds and rage baiters
local part = script.Parent
part.touched:Connect(function(Hit)
while true do
Instance.new("Part",workspace)
end
end)```
Yep, eliminating the issues
If they run the code they deserve it
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)```
i done it for u twin
Does anyone know how to get the pfp of someone whos not in the game
No with a script
!< is a thing?
why would you need that tho
not more than is just less than or equal to
has anyone used the Groove Animator
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
Ik but why does java script even have !<
If I rename a script, does script.parent still work?
Oh it doesn't, you were just wrong @snow veldt !!
so it would seem, i dont know where i got !< from
HM
OHH I MEAN ~<
woops
yeah, script is just what the code is inside of
That isn't a thing either tho
like the script itself
~< is valid
It's invalid everywhere 😭
Because it's pointless
nahh its not though coz years ago when i was learning, idek if it was c++ or js
There is literally no use of it
i was using it because it was a conenient way of doing something instead of using stuff like ! (a < b)
OHHHHHHH
WAIT NO I DID USE THE js ! ( a < b ) i thinkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
I forgot what i done
OH yeah i think i just done >=
.
who here knows OOP looking for commissioned work everything provided (3-5 days project) dm me
Yo does anyone know a website where you can buy roblox system and games.
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
peak coding
☠️
I like the font
i was gonna say the complete opposite 
thank u
Made custom signal handler
thanks
np homeboy
this is an error by iterating and removing at the same time\
it would create unexpected results
and why use buffers and make it overly complicated
what should i try to make i do t have any ideas 🙏
Genuine question ?
yea i mean like i wasn't misinformed right?
havent coded much yet im still learning the basics
Nuh uh you were right
I wasn’t
It’s a magic spell
alr thx
It doesn’t have air resistance
I just don’t recommend using _G because of security reasons
security?
Yuh
It’s unsupported now anyways
Exploiters
Just use modules right
what could they do
Or bindableEvents
And module scripts are better
Yh
Yup
not security
HAOO 👋
just organization, and you lose intellisense
hi ghost
If it’s on the client side then it’s exploitable
Myea
That’s hurts my eyes
now convert each client side script to server side 💯 🗣️
Why would it be error It works just fine
You mean the for indec, value loop?
Roblox already has this covered
what do you think is the output for this
Meh I will do for index=1 loop and increment index by the amount it removes
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
What is the point
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
Just everything
you're buffers are only size 2
Yeah
a vector3 would take up less size btw
so would a number
and you index them to an array either way
Why would you need a signal handler?
so at the end you're not saving any
Yes but I need to store two numbers and tables take 40 or 20 bytes
I don't see the use case
each buffers take up 16 bytes
16 + overhead + size
a vector3 takes 16
a number takes 16
For stuff where I would use roblox's native signals like UI events and stuff like that
What does it even do?
Simply store them?
Its in the name
I dont believe that buffer is more expensive than vector3 with its float-point precisions and metadata
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
a vector3 is a primitive type
Why do you add methods doing
function Signal.Connect(self, Callback)
end
when you could just do
function Signal:Connect(Callback)
end
?
prefrence
ic
plus you get to type check it

Thats not very scalable and creates table for every signal which stores its values and then you have priority system in bigger scales mine will work better
instead of assigning a pointer
Mainly because I dont want to shift table indexes and whole tables whenever I remove something
you still shift the table
when you disconnect
so not sure what you're point at
or you could just use a linked list
or a hashmap
the whole point of having global table is to reduce the amount of tables, centralize the environment and make it scalable
i'd say you're system would be less scalable
Its small amount of shifting and I also wanna change that
also this is a high level language not a low lanaguage
Why would you use a global table?
all primitives data types takes up the same base size
you'rs is also limited to 255 events
I don't understand where (function(...) ... end) gets called
in the Signal.Once function
because when you look at the Connection constructor
it only defines the callback
it gets stored in the connection
doesn't call it anywhere
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
which is called when Fire is called
Not really
you're making your system less scalable
and in this case using buffers isn't really benifiting you
and making it way more complicated then it needs to be
its to recreate roblox events like touched
for example
Oh
Is that all?
So instead of it being a roblox event
the script would call Touched
and another script could listen to it
well its meaing to create your own events
Well yeah
like when a custom object gets it's value increased
or changed
it fires a custom signal
hi
@random nebula what do you think
its overcomplicated and would be less efficent then a normal signal lib is what i'm saying
even ai cant generatetrash like this bro
damn
also @exotic minnow
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
Oh thats just for something outside
Yeah but why
Its a framework I made for my projects just has some basic dependncy loading with error handling
👍
this is how vectors are set vs a buffer
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?
and the base luau value type which is 16 bytes by default
i know the basics of coding but like whenever i try to make something my mind just goes blank 🙏
so keep learning
👍
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
the problem is efficiency
if you care about speed this isn't better then table
or better in the sense of memory
Simply use a table
if you want to make the fastest signal, use an array
buffers will not be faster until u exceed the cache size
SETTABLE is faster than CALL
which is like 4k+
well its fast call in this case
but its still slower lmao
well yeah
unless you have native
SETTABLE is faster
It is possible
you create a new buffer for each connection
which means its not
bro i guarentee you will not have 4k signal connecitons and if you do ur code is just ass
as they won't be guaranteed on the same cache or next to each other
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
Just don't do it
but I need to bro
ask chatgpt
