#code-discussion
1 messages · Page 203 of 1
local i = 0;
while true do
if i == 10 then
i = 0;
task.wait();
end;
end;
how does this even work lul i isnt incremented?
i wrote that shit on mobile lmao
i dont think that does what u want tbh
?
i dont think thats slower than while task.wait() do end
wait how does that speed it up
my end goal is to "speed" up my while loop, it has to be a while loop, because the slowest runservice event (heartbeat) is too fast
how is that faster tho?
how can "timed waits" not be faster?
what even is ur goal anyways
at 60 fps each of them run 60 times per frame
the latter, you wait after each loop, the former you wait essentially after each 10th
how
each task runs 10 times
đ€
before yielding
...
i dont get it tbh
ur saying ur creating multiple tasks in the first version?
and by creating multiple tasks it speeds up the while loop?
no it runs
multiple task
it runs the same task multiple times
lets say you are creating parts
with the if i == 10 ... then you create 10 parts per frame
with just while task.wait() do you create 1 part per frame
ok
i thinkn i have to consult chatgpt
how r u making new tasks without calling task.spawn or smthing
its not making a new task
local i = 0;
local function _task()
Instance.new('Part',workspace)
end
while true do
if i == 10 then
i = 0;
task.wait()
end
i+=1
_task(()
end
take this for example
how did you get syntax highlighting??
back ticks doesn't have it
add lua after the backticks
```lua
{CODE}
```
lua after first 3
assumign 60 fps task.wait(1/60) would run 30 times per frame
because the taskscheulder won't be accurate
so some frames would be skipped
this is my current test setup
https://gafferongames.com/post/fix_your_timestep/ look into an accumulator
Hello readers, Iâm no longer posting new content on gafferongames.com
Please check out my new blog at mas-bandwidth.com! Introduction Hi, Iâm Glenn Fiedler and welcome to Game Physics.
In the previous article we discussed how to integrate the equations of motion using a numerical integrator. Integration sounds complicated, but itâs just a ...
I can't use RunService, as it's too fast
u can ignore frames on renderstepped tho đ€
that's essentially what I had with, I'm saying what's a good time to wait?
accumaltor loop is better as you can have it run around the fps
I essentially want the lowest possible wait in a while loop
as no wait hangs the script
then check start-os.clock()
so just use like render stepped with no waits
until its bigger then a threash
isn't renderstepped clientside only?
i just copied what they sent
yes so use like heartbeat for smth else
run as much as you can then yield
check time using os.clock()-start
then how fast you want to run it? you said fast as possible..
this is what i'm talking about
so, use an accumulator, and essentially accumulate 60 before task.wait, because it's the fps is usually 60fps?
not 60
you check if os.clock()-start >= 1/60 - THRESH
then yield
as fast as possible in a while loop lol
and whats a good number for the thresh constant
depends on your task
if its a longer task then thresh should be larger
is its a very fast task then it can be smaller
see that's the thing, im making an A* pathfinding, which is obviously dynamic, so the task complete time varies
i was trying to think of a formula, like ((start - end).magnitude / walkspeed) / n
u dont need a while loop bruh
bruh
and why a while loop?
because the "lowest" RunService event (.heartbeat) is too fast
but u can just not do anything before the time is up
renderstepped:connect(function()
if time ready then
--do the stuff when time is ready
end
end)
i believe this is feasible?
đ€
has to be a while loop, runservice is too fast
i need something in the middle, while true do wait is too slow, and the latter is too fast
so this doesnt work đ€
hmmm
im considering what hao said, an accumulator
local yield_interval = (1 / 60) * FRAMES
local last_yield_time = os.clock()
while true do
-- work
local now = os.clock()
if now - last_yield_time >= yield_interval then
task.wait();
last_yield_time = now;
end;
end;
it should* work, but it would be too fast
i see
.. everyone suggested to use a basically cooldown so you can set the refresh rate so it isnt too fast đ€Š
no where was the word "cooldown" mentioned lol
i was already using "timed waits", and they recommended an accumulator, which is essentially the same thing, just more precise
this is kinda impractical
very
iframes? I'm making a pathfind system lmao
mind sharing your reasoning?
youre practically skipping a beat but in a impractical way
holdon lemme rewrite what i would use essentially
its a roundabout way to yield
so might as well just do task.wait
..
it does the same thing
it doesn't dude
it does
did you even read any of the messages I put lol?
true but same behavior in the end
instead of yielding per iteration
no I am, but I dont want to yield each loop
bingo
it's not lmao
its yielding when its near the frame
one is waiting every second, the other is only every nth second
would legit be same as task.wait(time you want)??
nah
local tfps = 60
local fby = 15
local yieldint = (1 / tfps) * fby
local lastyield = os.clock()
while task.wait() do
local now = os.clock()
if now - lastyield >= yieldint then
task.wait()
lastyield = now
end
end
take that for a spin
oh wait
buddy this is literally the same code lol
would it even run at a constant rate
his goal is to run as much iterations as he can without lagging
yep
yeah so task.wait()
I have a similar system along with my scheduler
if the iteration gets to expensive pause it to allow other tasks to run
and resume it at the next reuption point
sharing is caring đ
@tepid musk idk how to explain it just the one you were running doesnt define much so it would skip a beat and not work how youre intending
so its running at the max speed, and yielding as to not run too fast
it won';t
what?
where am i overstepping
from line 9 to line 6
it yields for 1 frame
then yields for another
then runs a task
yours will also run at rate of 1 iteration per frame
he is not trying to make an iframe i thought this is for fighting game such as a game like brawlhalla or smashbros where you need iframes intentionally
hes not making an iframe
would this even work? because your condition is checking if the elapsedtime is >= os.clock
he wants to a loop to run as much iterations as it can
avoiding iframe and holding max load
without going over the frame balance
ahhh i see
sorry @tepid musk i thought wrong i thought trying to make an iframe
post console/output
when ran
all good lmao, the accumulator worked
show the output
Are you testing in studio?
show this window after trying
how to send picture
if it's a screenshot you just snapped, you can press CTRL + V
Like this
else click the little + icon
view click output icon
the new layout is ugly as hell
i dont have option
mobile?
your window doesn't look like this?
it does but when i click + just says use apps not upload file
you can always drag the image on to the discord app
ah yes still not allowing
someone sell me a script that lets me change the color of my username above my head in game
do you have a custom overhead ui?
more
show me the yellow line
Nope just regular
im guessing it's inf wait for child
I don't think you can change that, you have to create your own overhead ui system
where's the script
show me the explorer
this
wsp
its gonna be semi horror
why not just learn programming
why would a programmer make a game for you, when they could just make them game by and for themself
i can semi build but i need ppl to help cuz i cannot do everything myself
but trust me i got a fire idea its simple tho
i can send u the idea in dms
Is it in a Google doc or are you going to type it to me one line at a time
i have like a whole layout
Is it organized and coherent for others to read?
yes
its more of a description but it says everything
wanna see the description in dms?
whats the idea
dms
Pretty much
Applications are tests, so you're required to prove your work
Its annoying, ik
But those are the rules after all
If I have a humanoid attach to an another humanoid
What is a good way to make one attach to the other freely
Like the second humanoid can move freely while being attached to
rope constraint or smthing
i can just ask chat gpt to add comments and you guys wouldnt know wouldnt it just be easier to interview people
im not going to do the gpt thing
can I pick some like 200 line code and make it 100 lines with comments so i dont have to go through 400
Nah just comment on what each section does
i thought i was doing that
@hasty mesa did mine and half my comments were just like âthis part countsâ
what
đŹ
i've never been in the PA dep
You werenât? I swear the name was like @wise turtle oh
Yall are different people
O.O
try it. don't forget to tell us if you got banned ( we need a scapegoat )
he realized đ
i dont see why this wouldnt work
damn i left and lost all my skill roles
if i use roblox-ts can i still get the lua programmer role 
you're not writing lua code, now are u?
USD
Even the maggots were gagging at the new roblox UI
If I write ANY language other than lua (niche languages like Pine Script) will I still get the programmer role?
Yea
W
Wait how do I prove myself worthy of the programmer role
Is there a test like the scripting role?
yo how do i fix this camera thing where it hides the parts in my game for a split second. its like a weak ahh occlusion culling or something
Maybe try preloading parts before the game loads in
If streamingenabled is on it might also be taking a second to load the parts before you can see them
nah it happens when u look at a certain direction, all parts are already loaded
Hey guys does anyone know how to get smooth realistic water
Model it idk
Check bio for cheap builder and good quality
no, ideally your code would be perfectly readable without comments
hey guys so i have this unique sliding system im working on and theres a small issue
you can sort of kick off walls cause i set the debounce too low should i patch this or keep it
its pretty cool but at the same time not intended
alright
hong lu.......
Wsp, how are y'all ?
Im looking for a good Scripter
Come dm if your interessed
funny thing https://devforum.roblox.com/t/worder-word-your-checks-to-be-readable-and-understandable/4008587
To be clear, this was made in 30 minutes as a fun project, and also DO NOT USE THIS MODULE FOR EVERY CHECK IN YOUR GAME !!! Use it whenever you need real readability of your checks for people who dont code that much in luau. Hello today im showing you a worder module. It allows you to check values like this. local object = Worder.new(1) -- exa...
yo ik its not lua but I need some help with my front page for my portfolio website. Should I put the navbar on the bottom on the home page (like in the screenshot) and the navbar on top on other webpages? Or should I just keep them all on top
and yes ik I still gotta add a margin-top here
Personally if your on a solo project it isnât really needed as long as u understand what ur doing could help a little with debugging and if someone else reads your code
nice scam
Makes sense
Not enough Knockback
Depends on what game u tryna make
I usally use it to separate my variables but thatâs just from muscle memory I guess
I just put an enter for each kind of variable
Gona start putting comments on functions
fast paced movement shooter
Yeah u can do that to
Idk if itâs only me, but it doesnât feel like you are actually hitting the wall
hey guys i want to get into scripting but i dont know where to start can yall recommend me vidoes or recources for scripting
yeah i need to add animations and maybe some fov/camera changes for that
also its more of like
kicking off the wall
than hitting the wall
no
Everyone is making a mining game
its studs tho
https://youtu.be/tbD2zkynxcc?list=RDtbD2zkynxcc cold take this is the best roblox ost alongside grace ultrasonic faith
"Hereby; Justice condemns you DEAD."
GAME: https://www.roblox.com/games/13559635034/Combat-Initiation
Hi again! Windforce had me on for another update, and I had a blast doing this! People really liked Castle Crusher, so I was very happy to compose for the game again.
Visualizer art and thumbnail by @tchock_xii. (Sal7)
Please, do not reu...
@neat mauve
Damn, every game now is studs
OH WOW YOU MEAN STUDS LIKE 90% OF THEM?
It's been the past 3 weeks since ive uploaded a video and im ready for the summer! And heres the music for telamon's sword (wind of fjords).
ya, its my first game
Every single game
bro give me a mining game pic that is studs
Mining game
Im not gonna go hopping through games to send u that
Search 'mining'
atleast itll earn some rbx
Lmaooo
already searched
Studs are kinda good to start tbh
Anything is
Studs are just replacement for creativity
đ«
'Oh yeah i thought stud style would fit my game' = 'I have no idea how to design'
You can make anything stud and it will work
That saying everyone is shitting studs
New top1 game drops? Let me guess ... STUDS
Frontpage? Studs
Or a roleplay
90% games in dev? Studs
thats callew following trends
ci has ridiculously good ost
idk how they did it
indeed
how do I make a portfolio? Like what website would you guys recommend using for a portfolio without paying for up-time?
hm
I need a scripter who script a horror game, I need somebody who is a beginner but still decently good
why can a vectorforce I made in a local script not be working? (it doesn't affect the part even on the client's side)
use the same technique you used in a server script, if it's still not working then you probably forgot something (like setting the force)
also I don't think vectorforces on the client is a good idea so I won't be surprised if roblox disabled it on that side
they started working for some reason after a few changes so I think they should be fine now, thanks
Why is coding genuinely hard for me to understand bro
I've been trying for the past days to understand scripting but it's not working
What topics did you try to cover? The experience is different for everyone but thereâs recommendations like
- Reading the Creator Hub documentation
- Reading pdfs about the language Luau is derived from, Lua- which might help you understand some more general programming concepts you can tie back to Luau
- YouTube tutorials, although this is a hit or miss depending on the Roblox yter channel, but for general programming concepts, itâs still good
- Studying open source code
- Asking questions about specific things youâre confused about
- There are interactive coding websites you can use to learn some things.
Are you trying to rush the learning? If you are, just take your time. Even when you understand most of the core concepts, thereâs still going to be a lot to cover and a lot to learn.
finally added camera as finishing touches
I want to learn Luau as fast as possible
I don't have alot of time
Yk
I only did yt tutorials
Well youâve met your problem
You do
Itâs harder to learn if youâre putting pressure on yourself like that
hey
are you interested in job
Dms
did
Check what I wrote above to someone else
Ignore the irrelevant bits but usually people recommend one of those
does anyone know how to make a hiring post ?
you need perms, try the TalentHub
it's probably like 4k R$ lmao
on what?
do i start with python or luau?
luau in my opinion, is easier
on one hand, i need luau asap, but everyone keeps saying python will make learning easier and set a better base
care to share your reasoning?
documentation
both have good documentation, luau has less keywords i believe though
idk it's the easyiest one i ever touched
python is easily top 5 most popular programming languages on earth
uh okay so it's subjective
One message removed from a suspended account.
wsp
yeah, and lua is also in that top 5...
luau is hard at some times
One message removed from a suspended account.
he's asking which is easier / best to start with
like what??
in what world? only roblox, waw and neovim(i think)use lua
python is used for basically everything atp
usages ~= complexity
like re-making the roblox pyshics again
no shit that's physics lmao
it is NOT that deep
ok i will start with luau then
ik i started with brawldev(i think) but i got demotivated
this summer
"who am i kidding? i better learn gdscript"
"hahahaha again"
Studs dont have that much to do with any game's success
well it depends, their simplicity is what makes the games so easy to digest
its just a style that looks decent and is easy to add
Where can I learn how to make assets in Roblox?
wrong channel bromosome
bruh im so lost. Why we using pcall when we dont even got data stores
its common practice and its used to prevent errors during runtime
Icl these type of Ai just ruines people skills
yes and to build
Make gui as well
It might be sloppy but it gets the job done
yea idk if thats a good idea for a long term game with many updates
it has its own dukes that stores all the data and prompts
with each game containing different files
bro said easy with ai on his second tab
Hell yes
I got AI doing my work
can someone help me finish a stamina run system?
ai slop đ€ź
This server doesn't allow anyone to buy/sell games
what software is this
nvm
Help me https://streamable.com/f103nb with my game
Watch "[BATS} TROLL TOWER!đđ - Roblox Studio 2025-10-15 02-20-22" on Streamable.
Whatâs up with the emojis
idk
yo who uses blender? i cant move my camera to a part
look up keybindds
Would requiring 5000 lines of code worth of module scripts at once be bad
cash grab final boss
yo
alr thanks
yooo i need help so i have a teleporting system in my game where you go from like the base kinda to different maps which are in a different experience but i was wondering if there was any was so that if for example if i collected a bandage and went back to the base for the bandage to stay in your inventory if you get what i mean?
Datastores.
You shouldnât be teleporting people to a different experience, just a different place
Someone give tips on moving a character along a bezier like for a super jump move
What ive tried looks buggy asl
Lerped it between points (server)
Tweening was hella bugged
How much have some of yall made from doing scripting commissions?
10k roblox for me
yes tha twould work
Hi, if Iâm making a movement system wit robloxâs charactercontrollerâŠ
can i set MovingDirection + BaseMoveSpeed every frame like a velocity?
I dont want to set HRPâs AssemblyLinearVelocity every frame bc i heard it resets all other forces
you just havent tried hard enoug
yes
Alr, ty!
Making a game using AI
suggest changes script wise ik the ui is trash
what kind of game is it
rpg floor based
i hope better
lmao
its got a lore
n rogue-like stuff
hm does anybody knows what Script that implemented this callback has been destroyed while calling async callback this mean
is that a standard roblox error or not
doesnt seem like a regular roblox error
yeah
but the script that has the callback was destroyed
heck that mean, the one giving the callback?
i mean i guess u are passing a function into another function but the original script that called was destroyed maybe đ€·ââïž
guys is adding Roblox api to your games that hard
?
so hard
physics is mostly math so like
unless you delve into physics algorithms which is probably quite complex and idk bout that
yo guys how do people make good showcases on roblox playtesting?
Idk
You figure this out?
is making your own Animate script efficient for combat games?
updateLeaderstats.OnClientEvent:Connect(function(plr)
gui.Values.Gems.Value.Text = plr.leaderstats.Gems.Value
end) this is not working
what's the error message
Players.Dreambro36.PlayerGui.ScreenGui.GameController:656: attempt to index nil with 'leaderstats' - Client - GameController:656
that means it's not getting the player model
(as in the player instance in Players)
what is the fix?
updateLeaderstats.OnServerEvent:Connect(function(plr, value, action)
if action == "Sell Blocks" then
plr.leaderstats.Gems.Value += value
elseif action == "Rebirth" then
leaderstats.Gems.Value = 0
leaderstats.Rebirth.Value += 1
end
updateLeaderstats:FireClient(plr)
end)
this is server side
then make a check, if leaderstats then --code here--
is ts even good
its saying plr is nil
ok try doing this then
oh wait I just realized
in your elseif state for rebirthing, you didn't reference "plr" in leaderstats
are you calling the rebirth function or the sell function?
in that case, put the gem count into the fireclient function
(player, gemcount)
so plr.leaderstats.gem.value
or whatever you set it as
then in the client gui, work from there, it shoudl be fixed
(also cuz I'm pretty sure when using fireclient, "onclientevent" already has the player instance as the first argument, so just refer to the gem count there)
nvm i updated it from server itself instead of again going to client and updating
does it update the gui?
yes
fire
updateLeaderstats.OnServerEvent:Connect(function(plr, value, action)
if action == "Sell Blocks" then
plr.leaderstats.Gems.Value += value
plr.PlayerGui.ScreenGui.Values.Gems.Value.Text = plr.leaderstats.Gems.Value
elseif action == "Rebirth" then
plr.leaderstats.Gems.Value = 0
plr.leaderstats.Rebirth.Value += 1
end
end)
see
oh yeah I didn't think of that since I never worked with guis
you could've also just, changed the params in the client communication and removed the plr arg
oh lol
since plr is already passed
idk how remote events work fully
im making a mining game btw lol
whats your issue?
right
simulator?
he wasn't able to update his gui on the client using remotevents
are you updating gui on the server side?
does anyone know how to disable the character auto swimming upwards when the player isnt moving in water
anchor 
won't swim at all, won't rotate, problem solved
bruh
(pretty sure Humanoid.AutoRotate works)
you can disable individual humanoid states, not sure if you can only disable it swimming upwards without making a custom swimming system
yeah
damn ok thanks
imo making a custom swimming module would be better since you have more control over it

I rlly don't
You don't know what is in my life so you don't know if I have alot of time or not
And I'm telling you that I dont
ya
do not ever do that đ
i got inspiration from mining simulator
why
Either way, I told you what anyone else would tell you
So if youâre choosing to ignore that, youâre just letting that get in the way of learning
Someone else could reply and itâd be a variation of one of the options I listed
guis are instances managed by the client, the server should never directly access it, if you want to update a player's gui, send a signal through a remoteEvent in order to update the displayed data to the player
yeah
it's not good practice to handle client instances on the server
#replicationlag
also is a module loader really that good
Im using motor 6ds to weld my armor to the player
is that good or should i use a normal weld
the server cannot see the player's gui (though that might be cause i do my own gui replication on the client instead of letting statergui handle it)
(server vs client)
always use motor6ds (when in terms of characters)
so something like
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Cached = {}
for i, modulescript in ipairs(ReplicatedStorage.Packages:GetChildren()) do
if modulescript:IsA("ModuleScript") then
Cached[modulescript.Name] = require(modulescript)
end
end```
use motor6d if you want your armor to be animated, otherwise use welds
don't weldconstraints cause collision issues upon player death
hm alr, cuz what I do is i have a motor 6d in every armor part, when equipping armor i read an attribute called part0 in the 6d and set the 6d part 0 to that (most likely a limb or the torso)
makes it reuseable
yeah that works
sure, but welds consume less memory than m6ds
in what sense, whats the point of using em
I don't think attributes are very resource intensive so you should be good
module loaders?
yes
right
you can achieve your own manual initialization with a module loader
grah ok
alright, and should I use cleanup modules? or are they unnecessary if you always handle garbage collection manually
yeah use trove or maid
you can also make your own one if you wish, they're not that hard to set up
i prefer to use trove for when i make classes
especially if i have a lot of connections to clear up upon destroying
so it's basically essential for spatial querying
for anything connection heavy related, and its less things to worry about too
just shove all of your connections to your local trove and clear them up when not needed
for me it shows the ui in server too
yeah probably cause you rely on startgui to handle the replication
i have a doubt, why when i mannually change the leaderstats value in server and update it it changes back to 0?
what do you mean by change and then update
change it in properties
update is through script when i press button
so i have all my modules work in a .init function where i pass the manager object thru (anim manager) is that kinda the same thing
show code
its a client script
yes
its like ```lua
local Combat = require(character.CharacterModules.Combat).init(manager)
and the rest for the rest
It's manual updating
Changing
I just do this in server / client for all the necessary modules
local Module = require()
Module.Init()
i have a similar set up too, with a startup function added in case i need to do any yielding actions post initialization
u probably change on the client
Yes i change it in client properties, but why does it go back to 0 when updated
do u update it with a script
Ya
send the script
im not dis advanced, i lowk jus use OOP for my states and anim manager
if you're using states managers/machines you're already doing a great job
what are promises?
promises are made to handle asynchronous code/functions
who even uses promises
something people do yet dont follow up to them
most of the times anyways
howd u get it to look like this
i use vsc with these and the jetbrains mono font
you can make one (in theory) using a discord rpc program
customRP i think its called
fair
flexing your roblox studio time đ„
so do people code in visual code the import the code into roblox studio
nah use rojo to sync it
wdym
usually auto synced by a program like rojo
whats the benefits of coding in visual code
more extensions
rojo opens a local webserver to send your code to roblox studio, on studio then there is a rojo plugin to recieve it
vsc isnt (really) an ide
true
ill start using vscode when i get better at lua
using extensions yeah
i dont find vsc worth cuz i barely use vsc extensions anyway
i dont find vsc worth it because neovim exists
i wanna learn neovim
do you feel much more profuctive on it than if you were to work on vsc?
yea
since i know its essentially keyboard shortcut based
whens speech to code
i'll definitly look into neovim since i find myself doing more and more terminal related stuff instead of relying on extensions
with shortcuts you press a bunch of buttons to do one action (ctrl + shift + b for example)
with modal you enter a mode so you dont have to constantly press 50 buttons to do one aciton
very nice
Thought this was dev discussion sorry
so it's a surefire way to handle connections?
also quick little help, should I make a remoteevent to the server to weld a tool's motor6d to the player's right arm or can this be done on the client exclusively?
hi um so i have like a teleporting system where when you sit in a car a ui pops up and you choose where to go but like when you teleport it teleports the seat with you anyone know how to fix this
ehhh its more of a way to have python's / typescript's "try" and "catch"
and you can also follow up on those
make the humanoid jump
ohhh
is it a localscript or script?
Just like irl promise: you promise a friend that you'll come to the party.
The outcome: you either go to the party or you break your promise and go somewhere else.
in a programming terms: we created 1 promise with 2 possible outcomes.
we create a promise and link it with 2 functions.
then we run some code, if the code succeeds, we fulfill the promise... if it fails or throws an error, we reject it.
-- create the promise
local goToParty = Promise.new()
-- the outcomes
function goodFriend()
print("You're a good friend, promise was fulfilled.")
end
function badFriend()
warn("You're a bad friend, promise was rejected ( failed ).")
end
-- pass in the 2 outcomes ( you can have more than 2, but let's leave this for another day )
-- first is onFulfilled, second is onRejected
goToPart:Then(goodFriend,badFriend)
-- code
-- / life
goToPart:Resolve()
-- of course there're many other ways to create/Resolve promises, and that's one of them
- see this for more info https://devforum.roblox.com/t/promises-and-why-you-should-use-them/350825
The following is an introduction to and justification for using my Promise implementation! If you just want to check out the library, click that link! Threads When writing programs, itâs possible to divide functions into two groups: âsynchronousâ and âasynchronousâ. A âsynchronous operationâ is one that can run to completion and ...
and im asking everying
weird
i spent 15 minutes making this script
weld on the server
ik how to code idk wth is going on
your script is straight up not being fired?
not at all
i got a contextactionservice on the enum.keycode.m
and in the top of hte funtions its print 1
try making a normal script and setting the run context to local
ayo what is this propaganda post
lemme read
BRO WTFFF
its not showing a error for that either
and i put it in a working script n its not doin either
imma try it in a whole other place
mmm
cause i just wanta reactiona t this point
you're sure its not your code itself?
im completely
100 percent
full certain its not that code
it wont evne let me send it bro wtf
--//Services
local TweenServices = game:GetService("TweenService")
local Players = game:GetService("Players")
local cas = game:GetService("ContextActionService")
local Player = Players.LocalPlayer
local PlayerGui = Player:WaitForChild("PlayerGui")
local UI = PlayerGui:WaitForChild("UI")
local SB = UI:WaitForChild("Scoreboard").SBFrame
local Lighting = game:GetService("Lighting")
--//Variables
local Toggled = false
local Cooldown = false
local function Toggle()
print(1)
if Toggled == false and Cooldown == false then
Toggled = true
Cooldown = true
local tweeninfo = TweenInfo.new(1, Enum.EasingStyle.Exponential, Enum.EasingDirection.In, 0 , false)
local tween = TweenServices:Create(UI.Frame, tweeninfo, {Position = UDim2.new(0.084, 0,0.104, 0)})
local tween2 = TweenServices:Create(SB, tweeninfo, {Position = UDim2.new(0.174, 0,1.1, 0)})
local tween3 = TweenServices:Create(Lighting.Blur, tweeninfo, {Size = 24})
tween:Play()
tween2:Play()
tween3:Play()
tween2.Completed:Wait()
Cooldown = false
elseif Toggled == true and Cooldown == false then
Toggled = false
Cooldown = true
local tweeninfo = TweenInfo.new(1, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out, 0 , false)
local tween = TweenServices:Create(UI.Frame, tweeninfo, {Position = UDim2.new(0.084, 0,-0.8, 0)})
local tween2 = TweenServices:Create(SB, tweeninfo, {Position = UDim2.new(0.174, 0,0.875, 0)})
local tween3 = TweenServices:Create(Lighting.Blur, tweeninfo, {Size = 2})
tween:Play()
tween2:Play()
tween3:Play()
tween2.Completed:Wait()
Cooldown = false
end
end
cas:BindAction("ToggleMenu", Toggle, Enum.KeyCode.M, Enum.KeyCode.DPadDown)
--cas:SetTitle("ToggleMenu", "ToggleMenu")
local UIS = game:GetService("UserInputService")
UIS.InputBegan:Connect(function(input, proccessed)
if input.KeyCode == Enum.KeyCode.M then
Toggle()
end
end)
--//Services
local TweenServices = game:GetService("TweenService")
local Players = game:GetService("Players")
local cas = game:GetService("ContextActionService")
local Player = Players.LocalPlayer
local PlayerGui = Player:WaitForChild("PlayerGui")
local UI = PlayerGui:WaitForChild("UI")
local SB = UI:WaitForChild("Scoreboard").SBFrame
local Lighting = game:GetService("Lighting")
--//Variables
local Toggled = false
local Cooldown = false
local function Toggle()
print(1)
if Toggled == false and Cooldown == false then
Toggled = true
Cooldown = true
local tweeninfo = TweenInfo.new(1, Enum.EasingStyle.Exponential, Enum.EasingDirection.In, 0 , false)
local tween = TweenServices:Create(UI.Frame, tweeninfo, {Position = UDim2.new(0.084, 0,0.104, 0)})
local tween2 = TweenServices:Create(SB, tweeninfo, {Position = UDim2.new(0.174, 0,1.1, 0)})
local tween3 = TweenServices:Create(Lighting.Blur, tweeninfo, {Size = 24})
tween:Play()
tween2:Play()
tween3:Play()
tween2.Completed:Wait()
Cooldown = false
elseif Toggled == true and Cooldown == false then
Toggled = false
Cooldown = true
local tweeninfo = TweenInfo.new(1, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out, 0 , false)
local tween = TweenServices:Create(UI.Frame, tweeninfo, {Position = UDim2.new(0.084, 0,-0.8, 0)})
local tween2 = TweenServices:Create(SB, tweeninfo, {Position = UDim2.new(0.174, 0,0.875, 0)})
local tween3 = TweenServices:Create(Lighting.Blur, tweeninfo, {Size = 2})
tween:Play()
tween2:Play()
tween3:Play()
tween2.Completed:Wait()
Cooldown = false
end
end
cas:BindAction("ToggleMenu", Toggle, Enum.KeyCode.M, Enum.KeyCode.DPadDown)
--cas:SetTitle("ToggleMenu", "ToggleMenu")
local UIS = game:GetService("UserInputService")
UIS.InputBegan:Connect(function(input, proccessed)
if input.KeyCode == Enum.KeyCode.M then
Toggle()
end
end)
just so i can read it better
Trying to help with 0 info is not a nice way to suffer
it's not even printing 1?
nope
quick little help 2: why does this cause so much lag upon deactivation
--// Services
local ReplicatedStorage = game:GetService("ReplicatedStorage")
--// Modules
local Bootstrapper = require(ReplicatedStorage["daybreak.Bootstrapper"])
--// Instances
local Remotes = ReplicatedStorage.Remotes
--// Create Functions
local function _Equipped(Player: Player, Tool: Tool)
local Character: Model = Player.Character
local animateScript: LocalScript = Tool:FindFirstChild("changedAnims")
local motor6D: Motor6D = Tool:FindFirstChild("Motor6D")
if animateScript and motor6D then
local rightArm = Character:FindFirstChild("Right Arm")
if rightArm then
local animate = animateScript:Clone()
animate.Parent = Character
animate.Enabled = true
motor6D.Part0 = rightArm
end
end
end
local function _unEquipped(Player: Player, Tool: Tool)
local Character: Model = Player.Character
local animateScript: LocalScript = Character:FindFirstChild("changedAnims")
if animateScript then
animateScript:Destroy()
end
end
--// Initialize Functions
Remotes["weldTool {Equip}"].OnServerEvent:Connect(_Equipped)
Remotes["weldTool {unEquip}"].OnServerEvent:Connect(_unEquipped)```
imma publish game and see if that works
what kind of keyboard do you have? azerty or qwerty
qwerty
open up dev console and see
good idea
and its another way to look at performance lemme see
no logs
rare ahh usage tho
legit never used it, or find a need to use it
Learn how to eliminate FPS drops caused by object creation in Roblox.
Enjoy!
0:00 Intro
0:27 Microprofiler Analysis
1:00 Solution
1:22 Implementation
2:05 Results
Model link: https://create.roblox.com/store/asset/138621294568819/ObjectPool
Join my discord channel for more resources:
discord.gg/jXu992HfAM
#roblox #robloxstudio #scripting #tu...
dont mind the video title
I was about to resort to this
he tells u how to go into the microprofile
it might be because I keep destroying and finding the animateScript
why do you have a keycode as the 3rd param, try switching it to a useinputstate
maybe, but it's still a use
what in the cursed naming
how cas works is that its the action title, function to run, buttons to press
its useful when it applies, but it rarely applies and i dont get why some people preach it so much like they use it everyday like promise is life 
and u can add as many keycodes that u want
cas = contextactionservice
its used for mobile buttons and stuff
yes but the 3rd parameter is an Enum.UserInputState not a keycode
and you have a Keycode
? its legit keycode tho?
i changed it n it still doesnt work
what did you put
Valid input enum items include those within the following: Enum.KeyCode, Enum.UserInputType or Enum.PlayerActions
cas:BindAction("ToggleMenu", Toggle, true, Enum.KeyCode.M)
even when i got it wrong i shouldve still gotten an error
i didnt get anything
true is a boolean not a Userstate... try putting Enum.UserInputState.Begin
what's the issue you're getting again
im not getting anything from this script im trying to run
the third param in bindaction is "create touch button", that's not the issue
ai ahh script
i changed it allready
i even put warn(3) from where the screen starts and i get nothing
if anyone needs a scripter for his game,dm me and i'll show you my portfolio
it's not an everyday use... but itâs never bad to learn something new
tbh I never seen anyone say: use promises itâs always the opposite, even to the point of hating on them like theyâre a plague
Ty new guy
its sum w roblox
its something w roblox
i dont think this is helpable
imma restart im computer
maybe its not taking in any of my edits
show me the contextActionService binding part with the changes made
alr
send me the script rq I"ve worked with cas a lot, it might be something I've fixed before
yeah but theres some outliers that somehow preach promises as the solution to everything đ
this is a cursed layout
--//Services
local TweenServices = game:GetService("TweenService")
local Players = game:GetService("Players")
local cas = game:GetService("ContextActionService")
local Player = Players.LocalPlayer
local PlayerGui = Player:WaitForChild("PlayerGui")
local UI = PlayerGui:WaitForChild("UI")
local SB = UI:WaitForChild("Scoreboard").SBFrame
local Lighting = game:GetService("Lighting")
--//Variables
local Toggled = false
local Cooldown = false
warn(3)
local function Toggle()
print(1)
if Toggled == false and Cooldown == false then
Toggled = true
Cooldown = true
local tweeninfo = TweenInfo.new(1, Enum.EasingStyle.Exponential, Enum.EasingDirection.In, 0 , false)
local tween = TweenServices:Create(UI.Frame, tweeninfo, {Position = UDim2.new(0.084, 0,0.104, 0)})
local tween2 = TweenServices:Create(SB, tweeninfo, {Position = UDim2.new(0.174, 0,1.1, 0)})
local tween3 = TweenServices:Create(Lighting.Blur, tweeninfo, {Size = 24})
tween:Play()
tween2:Play()
tween3:Play()
tween2.Completed:Wait()
Cooldown = false
elseif Toggled == true and Cooldown == false then
Toggled = false
Cooldown = true
local tweeninfo = TweenInfo.new(1, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out, 0 , false)
local tween = TweenServices:Create(UI.Frame, tweeninfo, {Position = UDim2.new(0.084, 0,-0.8, 0)})
local tween2 = TweenServices:Create(SB, tweeninfo, {Position = UDim2.new(0.174, 0,0.875, 0)})
local tween3 = TweenServices:Create(Lighting.Blur, tweeninfo, {Size = 2})
tween:Play()
tween2:Play()
tween3:Play()
tween2.Completed:Wait()
Cooldown = false
end
end
cas:BindAction("ToggleMenu", Toggle, true, Enum.KeyCode.M)
--cas:SetTitle("ToggleMenu", "ToggleMenu")
local UIS = game:GetService("UserInputService")
UIS.InputBegan:Connect(function(input, proccessed)
if input.KeyCode == Enum.KeyCode.M then
Toggle()
end
end)
imma rest my pc rq
you still have true as your 3rd parameter, im pretty positive that does not work đ
its supposed to be an Enum.UserInputState not a boolean
aha...
you didn't make a simple check at the top
make 3 parameters in Toggle(), "actionName, inputState, inputObj", though inputobj won't be needed here
then do "if inputState == Enum.UserInputState.Begin then" and then run all your code there
and of course use the actionname
but Toggle isnt passed as a callback here
you set actionname as toggle so do a chcek for that too or there won't be a response
in bindaction, the first parameter is the parameter you're passing, and the second one is the function you're calling, the 4th one and onwards are all inputstates/keycodes
to confirm its (name, func, bool, inputs...)
yes
like local function Toggle(actionName, inputState, inputObj)
meaning if he wants to use Toggle he'll have to call the checks in Toggle first, and see if it's getting an inputstate
yes, check if it works
I had issues with combat games because of this
different bubble ig.
I had a module script that was a lot harder to use/read without promises... and bc I don't use them everyday and only know the theory I had to do the whole thing from the start ( search up a promisesLib, and learn it )
what was the module doing to require promises
where does the bool comes from đ
and i cant post the fucking code
its to show mobile button
i might have to just drop ts
hidden devs should add a way to bypass discord text limit đ
did you do the checks
just do "if actionName == "whateveryournameis" and inputState == Enum.UserInputState.Begin then"
what am I supposed to make of this
bro? đ
that's not supposed to happen, likely a replication issue because of ping
that's how it supposed to be, put whatever functionality in your toggle function
a customer manager script?
where new customers entering the shop should go trough a life cycle
function Customer.start(self: fullCustomer)
self._step = self._step + 1
if self._step > #customerLife then
self:finishedLife()
return
end
local promise = promiseModule.new()
promise:Then(function()
self:start()
end
,function()
self:leaveStore()
end)
customerLife[self._step](self,promise)
end
function Customer.spawn(self: fullCustomer,promise: promiseModule.promise)
local newCustomer = self.customer:Clone()
self.customer = newCustomer
newCustomer.Parent = spawnInFolder
newCustomer:PivotTo(
CFrame.new(self._shop.customerSpawn.Position,self._shop.entrance.Position)
)
promise:Resolve()
end
function Customer.enterShop(self: fullCustomer,promise: promiseModule.promise)
local model = self.customer
local humanoid = model:FindFirstChild("Humanoid")
if not humanoid then
promise:Reject()
return
end
local goTo = newPath(humanoid,model.PrimaryPart.Position,self._shop.entrance.Position)
if goTo then
promise:Resolve()
end
end
customerLife = {
Customer.spawn,
Customer.enterShop,
Customer.headToCashier,
Customer.headToCounter,
Customer.finishedLife -- leave shop/destory
}
thats how i put it
dont see why you need a promise here?
whats the issue even
maybe there's another way to do it... that ensures that each step will wait for the one before it to finish, without yeilding the whole script
no issue, just showing the code
how would you do it?
is this cool or no
--// MalevolentDawn
--// Settings
local cameraHeight = Vector3.new(0, 1.5, 0)
local cameraSmoothness = 0.15
--// Services
local RunService = game:GetService("RunService")
--// Variables
local Character = script.Parent
local Humanoid = Character:FindFirstChildOfClass("Humanoid")
local HumanoidRootPart = Character:FindFirstChild("HumanoidRootPart")
local Head = Character:FindFirstChild("Head")
--// Create Functions
local function lerpCamera(deltaTime)
local targetOffset = HumanoidRootPart.CFrame * CFrame.new(cameraHeight)
local offsetVector = targetOffset:pointToObjectSpace(Head.CFrame.Position)
local currentOffset = Humanoid.CameraOffset
Humanoid.CameraOffset = currentOffset:Lerp(offsetVector, deltaTime)
end
--// Initialize Functions
RunService.RenderStepped:Connect(lerpCamera)
im going through a crisis rn
well what is the purpose of the promise currently?
man I'm done making the tool weld
I'll just use moon animator later and easyweld it
if promise somehow fails(how?) itll leave the store instead of start/enter?
from what I understand promises basically ensure a resolve in case a function runs into a roadblock
yes so whats the roadblock here
its fucked
i even take everything outt he scirpt
and just say warn(3)
and niothing
yo script in the void
yeah no it's a roblox issue then
this whole game ging in the trash
didn't see the script đ
wheres your script located
playerscripts
yes... I'll try to make it go to the previous step but not now
well what is the purpose of the promise currently?
keeping track of the cycle/steps, and running the next one after it finishes
function Customer.start(self: fullCustomer)
self._step = self._step + 1
if self._step > #customerLife then
self:finishedLife()
return
end
local promise = promiseModule.new()
promise:Then(function()
self:start()
end
,function()
self:leaveStore()
end)
customerLife[self._step](self,promise)
end
local script
should run tehn
there was a few other issues that I had before switching to promises... but I don't remember them :(
man don't worry
it's probably just a roblox bug since no script is running
- your character turned into.. an abomination
and how would :start fail
try adding any print at the first line and see
the cycle will tell it
function Customer.headToCashier(self: fullCustomer,promise: promiseModule.promise)
if not foundCashier then
promise:Reject()
end
-- code
local function moveInQueue(to: Vector3)
if not goTo then
promise:Reject()
return
end
end
-- code
queueManager.add(foundCashier,queuePos,moveInQueue, function()
print("Left")
promise:Resolve()
end)
end
--//Services
local TweenServices = game:GetService("TweenService")
local Players = game:GetService("Players")
local cas = game:GetService("ContextActionService")
local Player = Players.LocalPlayer
local PlayerGui = Player:WaitForChild("PlayerGui")
local UI = PlayerGui:WaitForChild("UI")
local SB = UI:WaitForChild("Scoreboard").SBFrame
local Lighting = game:GetService("Lighting")
--//Variables
local Toggled = false
local Cooldown = false
warn(3)
this is the only thing in the script
so you delegated the implementation of leaving to promises instead of your actual code đż
what you couldve done is replace all those :rejects with :leavestore
and all resolves with :start
maybe i gotta update studios
but what if I wanted to change :leavestore ?
or wanted to make the reject function call the previous step? then add a new step before in between older ones?
then you should add all changes in leavestore
and if you want to do other than leave store
then you should add another method that contains leavestore in it
hell you can even name it :reject if you wanted to
send a ss of ur explorer
its a roblox thing
doubt it
talk wha tu know cat person
it wont even print one
speak English ?
do u think ima wizard
the opposite
and whats the opposite of a wizard
send a ss of ur explorer
you.
u dont think
special
this is why ur a cat person
what are u even saying
wizards are special
youre special in a different way...
God is fake â
God is great 
idk why but it seems off to me
he might help you with your mental challenges
imma pray for u cat person đđż
Why are we talking about god in code discussion?
Why are we not?
Because this is the code discussion area?
Alright đ
Bro these devs who build are horrid
I canât even find a good builder for Roblox studio
This is sickening
I know a good one but wouldnât recommend him cause heâs hella pricey
The problem is the bad ones reply quickly
:3333
No no
Building is a art not everyoneâs good at it imo
I already have a lot of work to do
just.. get good at art!
typical behavior
I 3D model halfway decent yet my building is still trash
Why do u think im hiring people ?
I could make an entire game by myself but it would take to long and I donât have time
imo waiting is worth if the guys are professional and good at their work and keep updating you on their progress
They respond like every 12-24 hours
Itâs horrid
You check out what I posted in creations Iâm looking for feedback
like they the next devinci
Ik how to code in Lua
i know a good builder that answers normally
do you want his contact?
But being able to build something and actually be good at it is something else
Sure
add him, its_skyheaven
If that donât work out and you have a big boy budget I know one who responds but heâs gonna charge you a lot đ
Itâs depend on what you wanted
No clue on his prices I trade scripts with him for builds
But he could show you his work
Good stuff
Yeah thatâs what they call Roblox exploits
Preciate it
đ
I wanted to go and switch the script to without promises.
but I had 2 questions... and what if the code errors? what if I wanted to use threads in the cycle?
for the first question it's easy, just a pcall will do
your code shouldnt error or else it is unfinished/designed badly
but idk about the second
wym by 2nd
what if I wanted to use threads in the cycle?
why not? I pathFind inside the cycle... and it's normal for it to error/get stuck
then pcall any expected errors
Sorry
thread: task.spawn
cycle: functions inside of this ( idk what to call it )
for i,v in customerLife do
v()
end
customerLife = {
Customer.spawn,
Customer.enterShop,
Customer.headToCashier,
Customer.headToCounter,
Customer.finishedLife -- leave shop/destory
}
Spawn function exists
Or just use plain old coroutines
Oh wait
I just read the whole post đ
lf excellent LUAU scripter
z
Python >
who wanna help me script a thing in my game, for portofilo (no payment)
shouldnt take long
some might already have it
your one of these ppl yeah
I think were going in circles... so how would you rewrite this code without promises?
function Customer.start(self: fullCustomer)
self._step = self._step + 1
if self._step > #customerLife then
self:finishedLife()
return
end
local promise = promiseModule.new()
promise:Then(function()
self:start()
end
,function()
self:leaveStore()
end)
customerLife[self._step](self,promise)
end
-- functions inside of the cycle can yield, error
-- and they shouldn't care if new functions got added/removed from the cycle ( customerLife )
function Customer.enterShop(self: fullCustomer,promise: promiseModule.promise)
local model = self.customer
local humanoid = model:FindFirstChild("Humanoid")
if not humanoid then
promise:Reject()
return
end
local goTo = newPath(humanoid,model.PrimaryPart.Position,self._shop.entrance.Position)
if goTo then
promise:Resolve()
end
end
customerLife = {
Customer.spawn,
Customer.enterShop,
Customer.headToCashier,
Customer.headToCounter,
Customer.finishedLife
}
tf, you have someone to help you with portfolio is crazy
not my portofilo, theirs
đż
Well ok hear me out c# genuinely is better
im not a scripter and i need help
it's a hire 1 get 2 offer
he said no pay
yeah
you can get hired without pay :D
He wasnât kidding

