#code-discussion

1 messages · Page 203 of 1

hasty mesa
#

stepped runs at 240

#

heartbeat runs at 240

iron kraken
#

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?

hasty mesa
#

it dosn't

#

have to increase i

tepid musk
#

i wrote that shit on mobile lmao

iron kraken
#

i dont think that does what u want tbh

hasty mesa
#

it would run a task more times per frame

#

making it faster

tepid musk
iron kraken
#

i dont think thats slower than while task.wait() do end

tepid musk
#

bro i want to speed it up

#

what

iron kraken
#

wait how does that speed it up

tepid musk
#

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

tepid musk
iron kraken
#

how is that faster tho?

tepid musk
#

how can "timed waits" not be faster?

iron kraken
#

what even is ur goal anyways

hasty mesa
#

at 60 fps each of them run 60 times per frame

tepid musk
hasty mesa
#

instead of 1

iron kraken
#

how

hasty mesa
iron kraken
#

đŸ€”

hasty mesa
#

before yielding

tepid musk
#

...

iron kraken
#

i dont get it tbh

hasty mesa
#

explain what you don't get

iron kraken
#

ur saying ur creating multiple tasks in the first version?

#

and by creating multiple tasks it speeds up the while loop?

hasty mesa
#

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

iron kraken
#

ok

#

i thinkn i have to consult chatgpt

#

how r u making new tasks without calling task.spawn or smthing

hasty mesa
#

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

tepid musk
iron kraken
#

add lua after the backticks

hasty mesa
#

```lua
{CODE}
```

balmy zenith
#

lua after first 3

hasty mesa
#

thats slower than a frame

#

usually

tepid musk
#
local string = 'hello world'
print(string);
#

neat

hasty mesa
#

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

tepid musk
#

this is my current test setup

hasty mesa
# tepid musk this is my current test setup
tepid musk
#

I can't use RunService, as it's too fast

hasty mesa
#

nvm you did 0.16

#

not 0.016

#

yeah but sometimes dt would be less than a frame

iron kraken
#

u can ignore frames on renderstepped tho đŸ€”

hasty mesa
#

so the delayed thread would be skipped and not run

#

yeah

tepid musk
hasty mesa
tepid musk
#

I essentially want the lowest possible wait in a while loop

#

as no wait hangs the script

hasty mesa
balmy zenith
#

so just use like render stepped with no waits

hasty mesa
#

until its bigger then a threash

tepid musk
hasty mesa
#

i just copied what they sent

balmy zenith
tepid musk
#

again, it has to be a while loop lmao

#

runservice is too fast

hasty mesa
#

check time using os.clock()-start

balmy zenith
hasty mesa
#

this is what i'm talking about

tepid musk
hasty mesa
#

you check if os.clock()-start >= 1/60 - THRESH

#

then yield

tepid musk
tepid musk
hasty mesa
#

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

tepid musk
#

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

iron kraken
#

u dont need a while loop bruh

iron kraken
#

bruh

balmy zenith
tepid musk
#

because the "lowest" RunService event (.heartbeat) is too fast

iron kraken
#

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?

#

đŸ€”

tepid musk
#

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

iron kraken
#

hmmm

tepid musk
#

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;
iron kraken
#

o_o

#

interesting

tepid musk
iron kraken
#

i see

balmy zenith
tepid musk
#

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

wet wharf
#

why are you guys devving i-frames

#

what typa of shenanigans you guys up to

balmy zenith
#

very

tepid musk
#

iframes? I'm making a pathfind system lmao

tepid musk
wet wharf
#

youre practically skipping a beat but in a impractical way

#

holdon lemme rewrite what i would use essentially

balmy zenith
#

its a roundabout way to yield

tepid musk
#

literally that's the whole point

#

i don't want to yield every loop

balmy zenith
#

so might as well just do task.wait

tepid musk
#

..

balmy zenith
#

it does the same thing

tepid musk
#

it doesn't dude

balmy zenith
#

it does

tepid musk
#

did you even read any of the messages I put lol?

hasty mesa
#

hes using it to run something

balmy zenith
#

true but same behavior in the end

hasty mesa
#

instead of yielding per iteration

tepid musk
tepid musk
tepid musk
hasty mesa
tepid musk
#

one is waiting every second, the other is only every nth second

balmy zenith
#

would legit be same as task.wait(time you want)??

hasty mesa
#

nah

wet wharf
#

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

balmy zenith
#

oh wait

tepid musk
balmy zenith
#

would it even run at a constant rate

hasty mesa
balmy zenith
#

yep

wet wharf
#

yeah so task.wait()

hasty mesa
#

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

tepid musk
#

sharing is caring 🙏

wet wharf
#

@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

balmy zenith
#

so its running at the max speed, and yielding as to not run too fast

hasty mesa
#

your curent versiopn would skip

#

and also be slower

wet wharf
#

where am i overstepping

hasty mesa
#

it yields for 1 frame

#

then yields for another

#

then runs a task

#

yours will also run at rate of 1 iteration per frame

wet wharf
#

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

tepid musk
hasty mesa
#

he wants to a loop to run as much iterations as it can

wet wharf
#

avoiding iframe and holding max load

hasty mesa
#

without going over the frame balance

wet wharf
#

ahhh i see

tepid musk
#

hm?

#

what's the output reading?

wet wharf
#

sorry @tepid musk i thought wrong i thought trying to make an iframe

#

post console/output

#

when ran

tepid musk
#

show the output

inland wren
#

Are you testing in studio?

tepid musk
#

show this window after trying

wet wharf
#

how to send picture

tepid musk
inland wren
tepid musk
#

else click the little + icon

wet wharf
#

view click output icon

tepid musk
#

the new layout is ugly as hell

wet wharf
tepid musk
wet wharf
#

just say use apps

#

no pc

tepid musk
wet wharf
#

it does but when i click + just says use apps not upload file

tepid musk
#

you can always drag the image on to the discord app

wet wharf
#

ah yes still not allowing

tepid musk
#

try in a dm or group

#

maybe it's this server

timber prism
#

someone sell me a script that lets me change the color of my username above my head in game

tepid musk
#

more

#

show me the yellow line

timber prism
tepid musk
tepid musk
#

where's the script

#

show me the explorer

tepid musk
#

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

balmy zenith
#

fr

#

what do you even bring to the table if you need 3 other roles

dusky swift
#

but trust me i got a fire idea its simple tho

#

i can send u the idea in dms

inland wren
dusky swift
inland wren
#

Is it organized and coherent for others to read?

dusky swift
#

yes

#

its more of a description but it says everything

#

wanna see the description in dms?

iron kraken
dusky swift
#

dms

pearl inlet
#

Pretty much
Applications are tests, so you're required to prove your work
Its annoying, ik
But those are the rules after all

balmy garden
#

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

iron kraken
#

rope constraint or smthing

snow raft
#

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

inland wren
#

Nah just comment on what each section does

snow raft
#

i thought i was doing that

inland wren
#

@hasty mesa did mine and half my comments were just like “this part counts”

snow raft
#

these are what my comments look like

#

😭

inland wren
#

🚬

hasty mesa
#

i've never been in the PA dep

inland wren
#

You weren’t? I swear the name was like @wise turtle oh

#

Yall are different people

#

O.O

marsh kelp
sharp creek
#

he realized 💔

spring token
#

damn i left and lost all my skill roles

#

if i use roblox-ts can i still get the lua programmer role cathello

wheat pumice
#

you're not writing lua code, now are u?

rose notch
#

USD

digital fog
digital fog
digital fog
#

W

#

Wait how do I prove myself worthy of the programmer role

#

Is there a test like the scripting role?

next shadow
#

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

digital fog
#

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

next shadow
static forum
#

Hey guys does anyone know how to get smooth realistic water

fathom igloo
earnest bridge
merry wolf
#

Check bio for cheap builder and good quality

balmy zenith
shell ravine
#

hey guys so i have this unique sliding system im working on and theres a small issue

#

its pretty cool but at the same time not intended

south bridge
#

keep it

#

especially if you have like twisty maps

#

it'd be cool

shell ravine
gentle trench
#

Wsp, how are y'all ?

Im looking for a good Scripter

Come dm if your interessed

glossy swan
#
keen forge
#

hey bros

#

i cannot send videos until im bronze 3 or something right ?

shut quail
#

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

potent shell
tight hill
#

nice scam

hexed cedar
shell ravine
#

👍

hexed cedar
potent shell
earnest bridge
#

I just put an enter for each kind of variable

#

Gona start putting comments on functions

shell ravine
potent shell
earnest bridge
distant ingot
#

hey guys i want to get into scripting but i dont know where to start can yall recommend me vidoes or recources for scripting

shell ravine
#

also its more of like

#

kicking off the wall

#

than hitting the wall

earnest bridge
#

Ohh

#

Makes sense

cinder basalt
#

Amazing

#

Another mining game

#

The 500th this month

austere seal
cinder basalt
austere seal
shell ravine
#

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...

▶ Play video
idle musk
earnest bridge
cinder basalt
lean ocean
austere seal
cinder basalt
#

Every single game

austere seal
cinder basalt
#

Mining game

cinder basalt
#

Search 'mining'

austere seal
cinder basalt
austere seal
earnest bridge
#

Studs are kinda good to start tbh

cinder basalt
#

Studs are just replacement for creativity

earnest bridge
#

đŸ« 

cinder basalt
#

'Oh yeah i thought stud style would fit my game' = 'I have no idea how to design'

earnest bridge
#

I can’t defend studs more then what I just said

#

I hate studs too

cinder basalt
#

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

earnest bridge
#

Or a roleplay

cinder basalt
#

90% games in dev? Studs

icy inlet
#

games just copy eachother

deep glade
#

thats callew following trends

random nebula
#

idk how they did it

shell ravine
woeful trout
#

how do I make a portfolio? Like what website would you guys recommend using for a portfolio without paying for up-time?

crimson juniper
#

Tung tung caseohoni

#

Tung tung kai cenatini

clever escarp
#

I need a scripter who script a horror game, I need somebody who is a beginner but still decently good

exotic rapids
#

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)

shy cipher
shy cipher
exotic rapids
#

they started working for some reason after a few changes so I think they should be fine now, thanks

runic quiver
#

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

bronze path
#

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.
bronze path
fair copper
runic quiver
#

I don't have alot of time

#

Yk

bronze path
bronze path
#

It’s harder to learn if you’re putting pressure on yourself like that

quartz obsidian
#

are you interested in job

latent turtle
#

hi

#

how do i learn script in roblox studio?

bronze path
quartz obsidian
bronze path
#

Ignore the irrelevant bits but usually people recommend one of those

soft meteor
#

does anyone know how to make a hiring post ?

tepid musk
#

you need perms, try the TalentHub

turbid quest
#

"hey want job?"

#

luck ass

#

lucky*

tepid musk
#

it's probably like 4k R$ lmao

turbid quest
#

idk

#

i need opinions

tepid musk
#

on what?

turbid quest
#

do i start with python or luau?

tepid musk
#

luau in my opinion, is easier

turbid quest
#

on one hand, i need luau asap, but everyone keeps saying python will make learning easier and set a better base

gleaming crypt
tepid musk
turbid quest
tepid musk
gleaming crypt
turbid quest
#

python is easily top 5 most popular programming languages on earth

tepid musk
faint dirge
#

One message removed from a suspended account.

turbid quest
tepid musk
gleaming crypt
#

luau is hard at some times

faint dirge
#

One message removed from a suspended account.

tepid musk
#

he's asking which is easier / best to start with

tepid musk
turbid quest
#

python is used for basically everything atp

tepid musk
#

usages ~= complexity

gleaming crypt
tepid musk
turbid quest
gleaming crypt
#

but idk an good example

turbid quest
#

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"

tired aspen
#

well it depends, their simplicity is what makes the games so easy to digest

iron kraken
#

its just a style that looks decent and is easy to add

carmine cairn
#

Where can I learn how to make assets in Roblox?

turbid quest
vernal peak
#

bruh im so lost. Why we using pcall when we dont even got data stores

mint snow
sturdy pulsar
#

Making games and scripting got 100x easier man

#

Devforum is the method

#

😭

iron kraken
#

what

#

ur using ai to code ur game?

sturdy pulsar
#

Icl these type of Ai just ruines people skills

sturdy pulsar
#

Make gui as well

#

It might be sloppy but it gets the job done

iron kraken
#

yea idk if thats a good idea for a long term game with many updates

sturdy pulsar
#

it has its own dukes that stores all the data and prompts

#

with each game containing different files

sturdy pulsar
#

I got AI doing my work

frank crow
#

can someone help me finish a stamina run system?

onyx chasm
vestal coral
#

This server doesn't allow anyone to buy/sell games

lusty dove
#

nvm

zenith ravine
dire mica
#

What’s up with the emojis

ebon frost
#

idk

brisk delta
#

yo who uses blender? i cant move my camera to a part

ebon frost
#

look up keybindds

split hare
#

Would requiring 5000 lines of code worth of module scripts at once be bad

onyx oxide
charred mountain
#

yo

split hare
#

alr thanks

lapis kestrel
#

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?

tired remnant
topaz crypt
#

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

wanton cloud
#

How much have some of yall made from doing scripting commissions?

sonic copper
#

10k roblox for me

eager spade
#

opinion on viewports?

#

i need a mirror to work

#

basicly js to replicate lights

iron kraken
potent glen
#

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

snow raft
#

you just havent tried hard enoug

potent glen
civic karma
#

Making a game using AI

fair copper
#

finally fixed characterloading

#

what typa burnout

fair copper
iron kraken
#

what kind of game is it

fair copper
iron kraken
#

cool

#

like dungeon quest

fair copper
#

lmao

#

its got a lore

#

n rogue-like stuff

merry jacinth
#

hm does anybody knows what Script that implemented this callback has been destroyed while calling async callback this mean

balmy zenith
#

is that a standard roblox error or not

iron kraken
#

doesnt seem like a regular roblox error

balmy zenith
#

yeah

iron kraken
#

but the script that has the callback was destroyed

balmy zenith
iron kraken
#

i mean i guess u are passing a function into another function but the original script that called was destroyed maybe đŸ€·â€â™‚ïž

floral goblet
#

guys is adding Roblox api to your games that hard

lean ocean
#

?

abstract orbit
#

Yo

#

Can someone teach me how to script physics related things ?

balmy zenith
#

physics is mostly math so like

#

unless you delve into physics algorithms which is probably quite complex and idk bout that

fair copper
#

yo guys how do people make good showcases on roblox playtesting?

abstract orbit
#

Idk

lethal plover
#

You figure this out?

wheat pumice
#

it literally tells u

#

u forgot to add a listener, i.e. onclientevent

flat remnant
#

is making your own Animate script efficient for combat games?

proud fable
#

updateLeaderstats.OnClientEvent:Connect(function(plr)
gui.Values.Gems.Value.Text = plr.leaderstats.Gems.Value

end) this is not working

proud fable
#

Players.Dreambro36.PlayerGui.ScreenGui.GameController:656: attempt to index nil with 'leaderstats' - Client - GameController:656

flat remnant
#

(as in the player instance in Players)

proud fable
#

what is the fix?

flat remnant
#

do this instead

#

local leaderstats = plr:FindFirstChild("leaderstats)"

proud fable
#

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

flat remnant
#

then make a check, if leaderstats then --code here--

azure granite
proud fable
flat remnant
#

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?

proud fable
#

sell

#

gives error in client when i try to sell

flat remnant
#

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

dusky pendant
flat remnant
#

(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)

proud fable
proud fable
flat remnant
#

fire

proud fable
#

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

flat remnant
#

you could've also just, changed the params in the client communication and removed the plr arg

flat remnant
#

since plr is already passed

proud fable
#

idk how remote events work fully

proud fable
fallow gulch
#

whats your issue?

flat remnant
flat remnant
flat remnant
fallow gulch
craggy steeple
#

does anyone know how to disable the character auto swimming upwards when the player isnt moving in water

flat remnant
craggy steeple
#

bruh

flat remnant
#

(pretty sure Humanoid.AutoRotate works)

fallow gulch
craggy steeple
#

damn ok thanks

flat remnant
#

imo making a custom swimming module would be better since you have more control over it

fallow gulch
runic quiver
#

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

proud fable
fallow gulch
#

do not ever do that 🙏

proud fable
proud fable
bronze path
#

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

fallow gulch
# proud fable why

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

flat remnant
#

it's not good practice to handle client instances on the server

#

#replicationlag

#

also is a module loader really that good

void sluice
#

Im using motor 6ds to weld my armor to the player

#

is that good or should i use a normal weld

fallow gulch
# proud fable why

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)

flat remnant
fallow gulch
#

insanely powerful

flat remnant
# fallow gulch insanely powerful

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```
fallow gulch
flat remnant
void sluice
#

makes it reuseable

fallow gulch
void sluice
flat remnant
fallow gulch
flat remnant
#

yes

flat remnant
lean ocean
#

Manual initialization

fallow gulch
#

you can achieve your own manual initialization with a module loader

flat remnant
lean ocean
#

thats nit manual

#

not

#

a module loader loops through ur modules and initializes them

flat remnant
fallow gulch
#

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

flat remnant
#

so it's basically essential for spatial querying

fallow gulch
#

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

proud fable
fallow gulch
#

yeah probably cause you rely on startgui to handle the replication

proud fable
#

i have a doubt, why when i mannually change the leaderstats value in server and update it it changes back to 0?

fallow gulch
proud fable
#

update is through script when i press button

void sluice
somber vault
void sluice
#

its a client script

fallow gulch
void sluice
#

its like ```lua
local Combat = require(character.CharacterModules.Combat).init(manager)

#

and the rest for the rest

proud fable
proud fable
lean ocean
fallow gulch
somber vault
proud fable
somber vault
proud fable
somber vault
#

send the script

void sluice
fallow gulch
#

if you're using states managers/machines you're already doing a great job

flat remnant
#

what are promises?

fallow gulch
#

promises are made to handle asynchronous code/functions

balmy zenith
#

who even uses promises

wanton pecan
#

most of the times anyways

sharp path
fallow gulch
sharp path
#

oh vsc

#

wish roblox studio had discord pres plugin

fallow gulch
#

you can make one (in theory) using a discord rpc program

#

customRP i think its called

sharp path
#

I think i tried that

#

its just very inconvenient

fallow gulch
#

fair

balmy zenith
#

flexing your roblox studio time đŸ”„

ebon frost
#

so do people code in visual code the import the code into roblox studio

fallow gulch
ebon frost
#

wdym

balmy zenith
ebon frost
#

whats the benefits of coding in visual code

balmy zenith
#

more extensions

fallow gulch
# ebon frost wdym

rojo opens a local webserver to send your code to roblox studio, on studio then there is a rojo plugin to recieve it

fallow gulch
balmy zenith
#

vsc isnt (really) an ide

fallow gulch
#

true

random nebula
#

vsc can become an ide

#

but out of the box its just a shitty text editor

sharp path
#

ill start using vscode when i get better at lua

balmy zenith
#

i dont find vsc worth cuz i barely use vsc extensions anyway

random nebula
#

i dont find vsc worth it because neovim exists

fallow gulch
#

i wanna learn neovim

#

do you feel much more profuctive on it than if you were to work on vsc?

random nebula
#

yea

fallow gulch
#

since i know its essentially keyboard shortcut based

random nebula
#

its not really shortcuts

#

its a modal editor

#

but yes its keyboard based

fallow gulch
#

yeah that's what i meant, mb

#

interesting

balmy zenith
#

whens speech to code

fallow gulch
#

i'll definitly look into neovim since i find myself doing more and more terminal related stuff instead of relying on extensions

random nebula
#

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

fallow gulch
#

very nice

pastel pine
#

Thought this was dev discussion sorry

flat remnant
#

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?

lapis kestrel
#

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

fallow gulch
midnight dock
#

my script wont fire

#

at all
its in player scripts

#

its just bugging

fallow gulch
#

and you can also follow up on those

fallow gulch
midnight dock
#

and im asking ai

marsh kelp
# flat remnant what are promises?

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
midnight dock
#

and im asking everying

fallow gulch
midnight dock
#

i spent 15 minutes making this script

midnight dock
#

ik how to code idk wth is going on

fallow gulch
#

your script is straight up not being fired?

midnight dock
#

not at all

#

i got a contextactionservice on the enum.keycode.m

#

and in the top of hte funtions its print 1

fallow gulch
#

try making a normal script and setting the run context to local

midnight dock
#

and it wont even print

#

alr igu

balmy zenith
#

lemme read

midnight dock
#

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

fallow gulch
#

mmm

midnight dock
#

cause i just wanta reactiona t this point

fallow gulch
#

you're sure its not your code itself?

midnight dock
#

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)
fallow gulch
#
--//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

midnight dock
#

thank u

#

the ai even said it was perfect

#

do yk how crazy that is

marsh kelp
flat remnant
#

now I get it

fallow gulch
midnight dock
#

nope

flat remnant
#

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)```
midnight dock
#

imma publish game and see if that works

fallow gulch
#

what kind of keyboard do you have? azerty or qwerty

midnight dock
#

qwerty

midnight dock
flat remnant
midnight dock
#

and its another way to look at performance lemme see

flat remnant
#

no logs

balmy zenith
#

legit never used it, or find a need to use it

midnight dock
#

dont mind the video title

flat remnant
#

I was about to resort to this

midnight dock
#

he tells u how to go into the microprofile

flat remnant
#

it might be because I keep destroying and finding the animateScript

fallow gulch
#

why do you have a keycode as the 3rd param, try switching it to a useinputstate

marsh kelp
flat remnant
#

shold be variabels

midnight dock
balmy zenith
midnight dock
#

and u can add as many keycodes that u want

#

cas = contextactionservice

#

its used for mobile buttons and stuff

fallow gulch
#

and you have a Keycode

balmy zenith
flat remnant
#

I'l ltry handling ts in the client instead

#

and weld on the server

midnight dock
fallow gulch
#

what did you put

balmy zenith
#

Valid input enum items include those within the following: Enum.KeyCode, Enum.UserInputType or Enum.PlayerActions

midnight dock
#

cas:BindAction("ToggleMenu", Toggle, true, Enum.KeyCode.M)

#

even when i got it wrong i shouldve still gotten an error

#

i didnt get anything

fallow gulch
flat remnant
midnight dock
#

im not getting anything from this script im trying to run

flat remnant
midnight dock
#

i changed it allready

#

i even put warn(3) from where the screen starts and i get nothing

swift tartan
#

if anyone needs a scripter for his game,dm me and i'll show you my portfolio

marsh kelp
marsh kelp
midnight dock
#

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

fallow gulch
midnight dock
#

alr

flat remnant
balmy zenith
balmy zenith
midnight dock
#

--//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

fallow gulch
#

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

flat remnant
#

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

fallow gulch
flat remnant
#

you set actionname as toggle so do a chcek for that too or there won't be a response

flat remnant
balmy zenith
flat remnant
midnight dock
#

like local function Toggle(actionName, inputState, inputObj)

flat remnant
flat remnant
#

I had issues with combat games because of this

marsh kelp
midnight dock
#

im so fucking done

#

i dont even think i cant do it anymore

balmy zenith
fallow gulch
midnight dock
#

and i cant post the fucking code

balmy zenith
midnight dock
#

i might have to just drop ts

fallow gulch
#

hmmmm

#

i see now

balmy zenith
#

hidden devs should add a way to bypass discord text limit 👍

flat remnant
midnight dock
flat remnant
#

just do "if actionName == "whateveryournameis" and inputState == Enum.UserInputState.Begin then"

flat remnant
midnight dock
#

my character turned into a freaking noob

flat remnant
#

bro? 💀

#

that's not supposed to happen, likely a replication issue because of ping

fallow gulch
#

that's how it supposed to be, put whatever functionality in your toggle function

marsh kelp
# balmy zenith what was the module doing to require promises

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
}
balmy zenith
marsh kelp
#

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

marsh kelp
marsh kelp
flat remnant
#

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)
midnight dock
#

im going through a crisis rn

balmy zenith
#

well what is the purpose of the promise currently?

flat remnant
#

man I'm done making the tool weld

#

I'll just use moon animator later and easyweld it

balmy zenith
#

if promise somehow fails(how?) itll leave the store instead of start/enter?

flat remnant
balmy zenith
midnight dock
#

its fucked

#

i even take everything outt he scirpt

#

and just say warn(3)

#

and niothing

balmy zenith
#

yo script in the void

flat remnant
midnight dock
#

this whole game ging in the trash

flat remnant
balmy zenith
#

wheres your script located

midnight dock
#

playerscripts

marsh kelp
# balmy zenith if promise somehow fails(how?) itll leave the store instead of start/enter?

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
midnight dock
#

local script

balmy zenith
#

should run tehn

midnight dock
#

stayed up all night

#

working on this game

marsh kelp
flat remnant
#

it's probably just a roblox bug since no script is running

#
  • your character turned into.. an abomination
flat remnant
#

so it's likely a replication bug

#

give it a few days

marsh kelp
marsh kelp
# balmy zenith and how would :start fail

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
midnight dock
#

--//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

balmy zenith
#

what you couldve done is replace all those :rejects with :leavestore

#

and all resolves with :start

midnight dock
#

maybe i gotta update studios

marsh kelp
midnight dock
#

fuck roblox studios

#

why am i the only one with this problem

balmy zenith
#

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

midnight dock
#

i even

#

made a new place

#

n put the script in there

wheat pumice
#

send a ss of ur explorer

midnight dock
#

imma stop scripter

#

start hacking

wheat pumice
#

u wont be successful at that if you fail with a simple task

#

good luck

midnight dock
#

its a roblox thing

wheat pumice
#

doubt it

midnight dock
#

talk wha tu know cat person

wheat pumice
#

youre the only one having that issue

#

what

midnight dock
#

it wont even print one

wheat pumice
#

speak English ?

midnight dock
#

do u think ima wizard

wheat pumice
#

the opposite

midnight dock
#

and whats the opposite of a wizard

wheat pumice
#

send a ss of ur explorer

wheat pumice
midnight dock
#

u dont think

wheat pumice
#

special

midnight dock
#

this is why ur a cat person

wheat pumice
#

what are u even saying

midnight dock
#

wizards are special

wheat pumice
#

youre special in a different way...

midnight dock
#

all of gods children are special

#

but u though, special chromosomes

wheat pumice
#

God is fake ❌

midnight dock
#

God is great praysob

marsh kelp
midnight dock
#

imma pray for u cat person 🙏🏿

wary vigil
#

Why are we talking about god in code discussion?

midnight dock
#

Why are we not?

wary vigil
#

Because this is the code discussion area?

midnight dock
#

its not an area

#

its a channel

wary vigil
#

Alright 💀

robust wyvern
#

Bro these devs who build are horrid

#

I can’t even find a good builder for Roblox studio

#

This is sickening

wary vigil
#

I know a good one but wouldn’t recommend him cause he’s hella pricey

wheat pumice
#

mrrp mrrp mrewow

robust wyvern
#

The problem is the bad ones reply quickly

wheat pumice
#

:3333

robust wyvern
#

The good ones take days to respond

#

So I get no where bro

wheat pumice
#

just get good urself

#

easy fix

robust wyvern
#

No no

wary vigil
robust wyvern
#

I already have a lot of work to do

wheat pumice
#

just.. get good at art!

midnight dock
wary vigil
#

I 3D model halfway decent yet my building is still trash

robust wyvern
#

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

fallow gulch
robust wyvern
#

It’s horrid

wary vigil
#

This is why I prefer programming

#

Way easier

robust wyvern
#

Bro

#

😭😭

midnight dock
#

i can build n program

#

these builder be taxin

wary vigil
midnight dock
#

like they the next devinci

robust wyvern
#

Ik how to code in Lua

fallow gulch
#

do you want his contact?

robust wyvern
#

But being able to build something and actually be good at it is something else

robust wyvern
fallow gulch
wary vigil
#

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 💀

robust wyvern
#

How much

#

Is a lot

wary vigil
robust wyvern
#

What’s his average life

#

Price

#

Sorry I’m on mobile rn

wary vigil
#

No clue on his prices I trade scripts with him for builds

#

But he could show you his work

#

Good stuff

robust wyvern
#

scripts?

#

Like exploits?

wary vigil
#

No like Roblox scripts ?

#

I make them for him he builds for me

robust wyvern
#

Yeah that’s what they call Roblox exploits

wary vigil
#

Scripting for his game

#

In return he builds for mine

#

Is exploiting ?

robust wyvern
#

Ahh I see.

#

Alr well I’ll dm its_skyheaven

robust wyvern
fallow gulch
#

🙏

marsh kelp
balmy zenith
#

your code shouldnt error or else it is unfinished/designed badly

marsh kelp
#

but idk about the second

marsh kelp
balmy zenith
#

what does that mean

#

"threads" "cycle" ??

marsh kelp
balmy zenith
#

then pcall any expected errors

marsh kelp
# balmy zenith what does that mean

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
}
balmy zenith
#

so just use threads?

#

whats stopping you

wary vigil
#

Spawn function exists

#

Or just use plain old coroutines

#

Oh wait

#

I just read the whole post 💀

lapis sierra
#

lf excellent LUAU scripter

fervent bay
#

z

wary vigil
fossil pecan
#

who wanna help me script a thing in my game, for portofilo (no payment)

#

shouldnt take long

#

some might already have it

lapis sierra
marsh kelp
# balmy zenith so just use threads?

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
}
balmy zenith
#

tf, you have someone to help you with portfolio is crazy

fossil pecan
balmy zenith
#

🗿

wary vigil
fossil pecan
#

im not a scripter and i need help

marsh kelp
balmy zenith
fossil pecan
#

yeah

marsh kelp
#

you can get hired without pay :D

wary vigil
#

Someone should help my boy Alex here out

#

But it won’t be me

fossil pecan
#

if game is popular

#

ill still not pay anyone

#

just kidding

wary vigil
#

He wasn’t kidding