#code-discussion
1 messages · Page 48 of 1
I'm not a visual learner
read the docs
M
Anyone know why I'm unable to use table values from module scripts?
show code
for _, food in pairs(foodAssets:GetChildren()) do
if food:IsA("Tool") then
table.insert(foods,{
FoodType = food.Name,
})
return
end
end
Module ^
local hungerhandler = game.ReplicatedStorage.Hunger.HungerModule
local foods = hungerhandler
tool.Activated:Connect(function()
if tool.Name == hungerhandler.foods then
print(hungerhandler.foods)
end
end)```
script
youre returning nil
remove the return and put return foods at the bottom of the module
I can't require it then
??
yeah thanks
oh the bottom of the loop not the module?
no
return the foods table at the bottom of the module
and remove the return i circled
yeah ight
How do we feel about modules in instances tied to them
whqt is this issue
like I know it doesnt return one value but I need access to all of the values returned
@silver verge
your module isnt returning something
ok
its because I returned 2 values
instead of 1 and luau doesnt work with it
so it errors
yeah dont do that
also you don't need pairs nor ipairs anymore
documentation
hiatus on youtube, or the docs
by who
okthanks
https://create.roblox.com/docs
the docs are a reference manual for the roblox engine
thank u guys
Since when can we data store tables without using JSON encode??
forever?
what the fuck
it's primitives only
is there any vids i can learn of ?
i would stick to reading that first
Although you can encode the color3s and vector3s in your own way
mess around in studio
ok
before trying to watch videos
Learn the fundamentals of lua
let me read it
Then docs will make even more sense
ok
can anyone tell me which is better to use task.spawn or coroutine.create or coroutine.wrap
they basically does the same thing i guess
I think it depends on how much of control you need on the coroutine
for most basic usage task.spawn is fine
ok thx
youtube tutorials for the basics, documentation for anything after
good or bad
Hello!
I'm trying to make a checkpoint system, currently each section has a spawn point that (should normally) not be able to be spawned on until the player has passed their first section. Making that their checkpoint. When the game loads the RespawnLocation is set (with replicatedfirst) to a spawnlocation called InitialSpawn. Yet for some reason sometimes it will still choose a random spawnpoint out of the sections. How would i go about fixing this?
u could number them each 1,2,3 etc and then put them in a folder, and add a loop that cycles through each number when they touch the spawn
I have, they're all assigned to their own part and numbered automatically. Yet ROBLOX still choses to spawn at those SpawnLocations eventho I've defined the RespawnLocation to originally be InitialSpawn
i dont know too much about scripting, but ive made something like this before. u just need to use a loop with some if statements
try #code-help
What IP is that?
Yeah bro just reinstall 🥀🥀🥀
Error: Succes
anyone can tell me which to use task functions or coroutines
coroutine.wrap(function(arguments)
Your code here
end)(arguments)
Search up 'A-chassis'
I needa set up the soccer camera system where when you score it pans the camera to your character
completely different things
Linear interpolation
coroutines allow threads to be made and called asynchronously
and the task library allows you to manipulate tasks
Oh I didn’t read his question right
Wait no I did
He was asking whether to use task.spawn or coroutine
Pretty sure that’s what he meant
ah well coroutine.resume and task.spawn are essentially the same
well wrap creates a function not a thread
this doesnt make sense then if u know
cause wrap and create are similar not resume and wrap
resume and spawn are similar
u said u don’t use resume u used wrap
I kind of grouped them to be the same things (spawn and wrap)
but those are completely different things
task.spawn can spawn threads and functions
I didn’t say they were the same
I just said I never use resume
And I only ever use coroutine for functions
lol but did I say they’re the same
Why’s
That’s just a bad habit I got 😅
I don’t see the point of using coroutine wrap though
is task.spawn more optimized than coroutine
why would you wrap a function in a coroutine vs just call it?
task.spawn is a customized luau library
So it can run at the same time as other things
In the same script why else
also i only use coroutine.wrap too lol
It’s just quick and convenient
but you can’t control the thread as much with yields and stuff can you?
wouldn't that make it faster (if its specialized for luau)
no they are probably the same speed
Roblox just created the task library as a simple means for devs
because it also allows for multi threading
task library is basically a wrapper for coroutines
in a slightly looser way
Ask prime if you got questions he seems very knowledgeable about multi threading
Wait what’s the difference between coroutine and actors
it’s on the same thread as everything else
so basically
how roblox handles script execution is asynchronous for the most part
but serially through the script
if you create two seperate scripts they can run "at the same time"
but really they are running on the same thread asynchronously
If you put them in an actor?
Learn something new every day
basically this allows as you know multiple things to happen "at the same time"
its not really at the same time but the interpreter will try to switch between tasks during the clock cycle to make it seem like it is
now actors
Oh yeah I remember reading something like that
allow you to use other cores
on the device
which allows you to truly use other threads
cause each core on a device usually has a thread
oo I thought it only switches back and forth when it comes across any yields like wait()
which includes hyperthreading, because hyperthreading is basically just asynchronous threads
so basically this
imagine task1 is the red and the orange
and task 2 is the blue
synchronos would work one task at a time
asynchronous switches between the red-ish tasks and blue-ish tasks
Ohh
multithreading is actually two entirely seperate threads
which is what actors are for
So actors are multi threaded and coroutine is asynchronous
thats why people use actors for ai
because all that computational power
should be spread on other cores
rather than taking up all the bandwidth of the single thread
that lua runs on
is there a reason why my coroutines randomly run on a different worker threads though
How long have you been scripting for
1.5 years
all of them just switch to a random worker thread
because i believe the tasks are handled differently
it depends on where the task is handled
dont feel bad about yourself cause i do this full time
u can check my profile linked
I started when I was 9 or 10 but didn’t really start getting active experience until 13 or so
Now I’m trying to fill all the gaps I missed
In my learning self taught
I js recently started commissions it’s going good so far
i started when i was 9 but i just did 3d modeling and building until 2 years ago
worked on alot of big games tho but building and modeling isnt where the money is at
trust
That’s cool
Yeah I know I tried it once
I was mid and the pay was bad
Never working for a percentage again
percentage is where its at bro
where to learn how to script
just gotta find the right people
Only if the player base is trusted
Yeah
Go learn luau and then look at the Roblox api
If you get confused you have the whole server here and videos on YouTube
whats roblox api?
Everything you need to know about studio
I was looking fo a dash system with vfx and the tuts werent rlly good
Also sorry Roblox uses Luau not lua
I don’t suggest you use specific tutorials like that
It will make you really dependent on others and not able to think for yourself and problem solve
It’s good to have a community and ask questions but don’t get into the habit of lacking self sufficiency
It will hurt you in the long run and hurt your growth as a scripter
If you want to learn lua i recommend starting with watching youtube tutorials like alvinblox, thedevking, bricey
and if you want to get really good read the lua manual
The dev king might be a little outdated but his lua tutorials are good
u never stop learning as a programmer 🫠
yea cuz when I started modeling I would do any tut
Facts
DEAR CREATURES OF THE scripting realm REALM, THE BUILD REALM CALLS YOUR HELP, #⭐creations THE POOL IS CLEARLY BETTER THAN THE TAVERN AND THE NOOBISH BUILD! STAR IT
your country calls you.. skibidi
(don't star the others ezz)
what is that pool for
its for comparing who builds better between us 3
any tips on how to get a top down picture of my city for mini map ?
is there a dif beetween lua and luau
theres a u at the end
thats it?
anyone wanna buy this I'm selling it for 1500 robux, I'll take payment in pls donate.
you cant dev ex robux from pls donate
any tips on how to get a top down picture of my city for mini map ?
you cant dev ex robux earned in pls donate
@serene tulip I'm not taking the robux out for real money, I'm just gonna use it for games
probably add a black highlight w/ white outlines to buildings
add a grey highlight w/ black outlines to roads
kinda just screenshot it
its huge map 😭
where did you read this 🙏
I saw it on a vid
and it didnt work for me as well when I first started
That makes sense
You have to get the robux from your creations
And I guess they can check where you got it from
u get robux from the gamepasses you sell on pls donate, its the same as doing a commission
Yeah but they can check where the game pass was bought
not if its frome hazems place where he gets 10%
If it was bought on pls donate then you can understand what happens
ur still selling ur creation, just from his game
it doesnt matter
it does
lol go read devex requirements on help page
are u using ipairs
1500 for that is wild
it says nothing about that
where
Wait
If I earned my robux from a game pass that was bought from a game that I just used to collect robux will devex still work
Could someone assist in scripting my RNG game, coins system, boost system etc
Anyone????
if you are the owner yea
so it doesnt matter if its a template experience with no user visits
just as described
because thats all the game exists for
to collect robux from commissions
its should be fine I think
alr
wait i dont think it is bro 💔 🥀
its a recent update to the terms of use
its over bro 💔 🥀
just use shirts/pants
that wont fix my devex with the robux i already earned
then make a shirt/pants, send the robux off to a different account and buy the clothing from that account
i think that would be the only way
also what are the exact terms of this?
how many visits do u actually need
maybe just publish junk game and let a few people play it
I made a character selection script and its working fine but when the character dies they dont respawn is this a common problem?
show code and video of issue
ill do that just in case
or wait
i could turn my devex gamepass game into my demo for my application for the luau programmer role
pro tip: you can acquire free labourors (testers) from rate my avatar
and put it on my portfolio
ig
rate my avatar?
a game?
yes
search rate my avatar 2
then go acquire your “paid workers”
just make a booth
with some yap about how you are an upcoming passionate developer
thanks for the strat bro you a real one
minecraft villager strats bro
👍
If anyone have made advanced combat systems before, how did yall manage to prevent combat clashing between two parties?
why does making the height 100% make the div box dissappear
not enough context
jk i just waffeled LOL
any scripter wanna work n an rpg, you will be working along side another scripter
@stuck radish
try puting content in it
you're saying height = 100% but that means 100% of the available height
and there is no available height due to your parent (body)
also avoid spamming ids like that, prefer classes
how do i give it more available height
it kinda worked but i want it to extend the full length of the screen no matter how tall the page is
with out extending the page
if you put it on the body, it won't do that
i did
aside from that how do i put elemets behind each other or in front?
would it work like lets say moving someone infront of a line or bejind a line not side to side?
I think it's best if you try to learn the basics
cause i only learnt it as in order number go in like 1 2 3 4, then using flex to reverse it or change value locations
did
reading is not the same as learning
cause if you learned, the previous questions you asked should be self explanatory, no offense
i watched a 4 hour brocode video 😭
i gues she missed that part
watching & reading is not the same as learning
none taken
i wrote notes
to look back at if i mess up but i cant find anything about priority
layering
idk what it is called so ill just name it priority layering
you mean something like z-index or the order property of a flex child?
element {
z-index: whatever
}
A z-index attribute actually exist?
that property exists yes
Nice
Well, I don't work with CSS much, I mostly use Bootstrap
Though not to demotivate you @steep pebble
How to make tycoon buttons
what are the sub properties like auto, center
dw
wym
What do you want them to do?
position: absolute and setting top, bottom, left, right?
yh
They buy stuff and it spawns in the item
Do you know how to script?
thee values in the : ;
thx for the help btw
Nope
Learn it
@stuck radish you can probably show him the best resources
Thanks
- Beginner Course: Roblox Scripting for Beginners (approximately 5 hours)
- Advanced Course: Roblox Advanced Scripting (approximately 15 hours)
This is the first episode and beginning to become a Roblox Scripter/Game Developer! With 3 playlists (Beginner, Advanced, GUI) containing 50+ videos and 30+ hours of content, I will guide you through this journey to start making the games you want to create on Roblox!
DISCORD 📜
Join my Discord Community if you want scripting help, participat...
PATREON🎁
Get Access to My Scripts + More Perks by Becoming a Patreon Member!
https://www.patreon.com/BrawlDev
DISCORD 📜
Join my Discord Community if you want scripting help, participate in events/challenges, and make friends!
https://discord.gg/WC6kPu5W5P
ADVANCED ROBLOX SCRIPTING SERIES 🔴
https://www.youtube.com/playlist?list=PLQ1Qd...
i figured it out its just 1,2,3...

Thanks
I have 3 years experiences in script in roblox and wanted to ask if it's possible for me to remake the game grow a garden easy?
I mean it doesn't seems complex first seen
but the fruits growing up when you're offline might be quite hard
i am doing it rn it's not that hard
I'm pretty sure it's a table with all the fruit and maybe it calculate how much time have you been off and it calculate a factor that tell you how much the fruit have grown
you just save the time when the player logs off the game, compare the saved time to the current time to see how much has passed between logs when they join and then give the illusion that the plant grew
it's a pretty simple concept i'm surprised no one has thought of it until now
hey
i just wanted you to know that
im here for you
oh word
if you're ever struggling emotionally or financially, just give me a call
send me $90 im tryna get a switch game
90 for a switch game 
how outrageous
this isn't good for your mental health the most humble programmer alive
but i'm so humble
some even say too humble
sure you are, but do you really think that you will stay this way if you keep doing activities like such?
you need to stop gooning to zenless zone zero and most important of all, please stop gambling on genchin impact
you're right minglemer i need to reassess my priorities and get my life together!
that's the spirit!
Like 35 here
There's a chicken farm near me
And we got chickens from there before
thats actually fairly cheap considering eggs are expensive
well not in america
but here in europe they are
Expensive in America as well
Really? I heard they went down a lot following Trumps very bad decisions crashing the stock market
Yep people are using potato's instead of eggs for Easter
What 😭
I would have never thought of something like that lmfao
how do i actually make progress learning, i watched tutorials but now what
Is there a property all moving objects have that can get velocity?
someone write me a code that will teach me chemistry 💔
?
Question
Is there a script I could use that lets me put a function and be able to use that function in a different script?
Or is that already included with the studio
yea it's just a module script
Ok
just define the function then return FunctionName at the end for your ModuleScript
then when you type Func = require(ModuleScript) it lets you reuse the function you created
crap, i'm having difficulties with a script
-
the script is inside a UI, this UI has buttons to allow a player to change teams
-
when a player presses "Play" after selecting their team, they are meant to be respawned so that they spawn at their spawnpart
right now all it does is respawn the player, i'm assuming the problem is that the game has streamingenabled toggled on
i've tried making the spawnparts persistent by putting them inside a model, no game
also tried putting the spawns inside replicatedstorage, same deal
any tips? sorry for the text wall guys
Spawns should be in workspace.
thats how they were in the first place, streamingenabled won't load them since they're technically parts though right?
and the spawn parts are quite far from where the player initially spawns at, the map is 10k by 10k studs
is this messy or easy to follow
ty, i was tihnking about releasing it as part of my framework
or just using it to my self, im not sure
is this something for client server communication?
yes my own remote events
nice
it allows for disconnect/ reconnect for a certain id
so you can disconnect it when you want
is it lua ?!
yea
bruh im cooked
this looks so difficult
well no ones asking you to code like this
I'm currently trying to create dev prducts that if you buy sth gets e.g. +1000 poitns but no matter what I try it doesn't work, can anyone help me?
you can code this easier you mean ?
no games requires this type of code ?
theoretically no
but using a framework makes it easier and organized
so yeah thats why
alr alr thank you
yoda can i ask you an advice ?
i just learnt basic lua, more or less advanced level what can i do now to get hired ? @bleak glade
well do you have a portfolio
no
you can start there
i didnt do that
you can make small things or what not in studio
yes
my first job i didnt get paid much but the opportunity cost was so high, based on what i learned
do you remember what the task was ?
and whats best way to progress now, since i know pretty much all that needs to be knowns for basic games
sheesh ok
keep challenging yourself
np
Yo
is creating a portfolio in a discord server a good idea since I see a lot of people do it
Im fr trying to hire a lua scripter but aint nobody takin my money. I need help bru
wowee
All it does is spawn a part that can also spawn parts
Because I’m trying to do generation
that’s cool for like a cloning ability
What do you need help with?
buy me im cheap
any scripter wanna help and make an rpg u will be working along side another scripter
error after error i just cant figure out how to change a blocks color then make it go away after like a few seconds
after you step on it
wait mb i placed the ) wrong
Your missing brackets
You packed a punch but you forgot to punch 🥊 your buns hahahaha
his bracket at the wrong place
sorry i just started scripting
fixed it but the block still wont change color
Why
id want to create a game
Why
what are u tryna do here
You packed a punch but you forgot to punch 🥊 your buns hahahaha
after you touch a block, it should be able to turn a certain color
then change bafck to normal after a few seconds
oh
Did you, perhaps, put the code in the correct spot
are you suggesting i place it outside of the function>?
I mean the whole script
Where did u put it
its a script inside of the part
that should be colored once stepped on it
Ok, is the print happening?
yes
Put the code from the second if statement in the first
And parentheses around really red
local Time = 5
local Part = game.Workspace.touchPart
Part.Touched:Connect(function(P)
if P:IsA("BasePart") then
local InitColor = P.BrickColor
P.BrickColor = BrickColor.new"Really Red"
task.delay(Time,function()
P.BrickColor = InitColor
end)
end
end)
idk if i did properly
im on phone
i did some caps error and stuff oop
local touchPart = game.Workspace.touchPart
local partIsTouched = false
touchPart.Touched:Connect(function(otherpart)
if partIsTouched == false then
partIsTouched = true
touchPart.BrickColor = BrickColor.new("Really Red")
task.wait(1)
if partIsTouched == false then
partIsTouched = true
print(otherpart.Name)
task.wait(1)
partIsTouched = false
end
end
end)
still doesnt work
You should only have one if statement
how would i make the
if partIsTouched == false then
partIsTouched = true
touchPart.BrickColor = BrickColor.new("Really Red")
task.wait(1)
tho
It looks right, put the partIsTouched == true at the end or maybe ur using brick color wrong
Convocator probably knows better
I love coding, but I hate when my code doesn't work (whihc is 90% of the time)

I'll spend 20 minutes coding, thinking im so smart and i've finally found a fix.. just for it to be the exact same as before
wait so
oh
wait
reef
u want it to make ur entite character red?
entire*
or
show me ur explorer rq
any scripter wanna help and make an rpg u will be working along side another scripter
put a print command after the touchPart.Touched:Connect line to see if its even working
btw, you shouldn't need the if statements if you make sure to automatically make partIsTouched = True and False at the begining and end
uhh
yk if you set partIsTouched to true
its not gonna go pass the if statement
because partisTouched is always gonna be true in that case
i dont think creating a brick that changes color and turns back can be that convoluted imo
guys chatgpt better than yall
Yo does anybody know why my robux eggs in my simulator game works inside roblox studio but when u buy it in the actual game the player doesnt get the pet
I'm kinda new to scripting so finding any error is quite hard
send code
Can someone explain to me why I cant get the clickDetector.MouseHoverEnter to actually work, like I've tried to like 30 minutes now...
I might just be stupid
who made chatgpt tho? who made chat gpt better tho? Youre an imbecile, how to prove youre a low iq without saying youre a low iq 
its MouseEnter
Basically Im trying to make it so that when I hover over a part, the part will get a slight highlight and rotate to the player, but I cant seem to get the mouse hover thing to work at all
Yea the camera will be locked into a position close to it
I just made like a super simple thing to try to get the mouse hover part to work:
local part = script.Parent
local detector = script.Parent.ClickDetector
detector.MouseEnter:Connect(function(player)
part.Highlight.Enabled = true
end)
Even that doesnt work
the part already had a highlight?
and the click detector too?
hm..
my old version struggling with a few hundred instances vs my new version handling a few thousand (the flat one is the new one btw)
Anyone need any scripting help im a 6 year scripter?
try making it a script instead of a local
That works, problem is I need the function to be local
sorry uhmm what are you trying to do i may be able to help?
Not server sided
Basically Im trying to make it so that when I hover over a part, the part will get a slight highlight and rotate to the player, but I cant seem to get the mouse hover thing to work at all
ray casting
problem with ray casting is hed have to use a loop that raycast his mouse
mouse.hit
or wtv
well thats the only way i see
yeah but i mean its probs best to use and most effiecient
Anyone know a good tutorial or documentation on using raycasting for mouse positions then? xd
oh wait there might actually be a better way
Yea?
With uh
mouse.Move
u make a connection with it and check the mouse and if its on that part that u want to highlight
then it does
That won't necessarily work since the camera can move if the character moves
i dont get what youre trying to say here
Idk if it still classify camera shift lock movement
as a mouse movement
if thats wym
Even if it is locked, the camera moves when the character moves, the mouse can move off of an object without moving the mouse specifically
thats fine
But doesnt that just mean that if I lock the character, that wont be a problem?
If you lock the character it won't be an issue yea
Or you can update it when the camera moves and when the mosue moves
ye
Does this not work in LocalScripts or am I tweaking
It would only work in local scripts, you can't really know where the mouse of someone is server-side
ray casting is 10X easier
You should use raycast as opposed to mouse.hit, but it doesn't really solve the issue of when to raycast (or mouse.hit)
Although, ignoring mobile, mouse.hit is totally easier than raycasting for general purposes lol
I mean, the part will only be accessible at certain times, like when a player goes to a specific shop or whatever, they will be taken to a table where the part will be, and ONLY then will they be able to access it
So the "when to raycast" part wont neccessarily be that big of a problem
Yea, I was just pointing out that raycast doesn't solve that particular issue
Ah
im 6 year scripter making a roblox game anyone interested in helping scripted basic its a parkour level game need more help though
are coroutines only useful if there are multiple loops in a script?
GuiButton.Text = "On"
GuiButton.MouseButton1Click:Connect(function()
if GuiButton.Text == "On" then
GuiButton.Text = "Off"
script.Parent.Parent.HUD.Canvas.Currency.Visible = false
else
GuiButton.Text = "On"
script.Parent.Parent.HUD.Canvas.Currency.Visible = true
end
end)```
i want it to when pressed and switched to off that the color changes too how to do it?
Try color3
I think its like GuiButton.Color3 = Color3.New(1,0,0) or something like that.
it is a gui button so it doesnt work with it
hmm,
Let me see if I can do it,
i got it to work
ty
but if u got something tell me maybe ur way is better
There's a bunch of uses, but generally, only really sueful if you want to have multiple runtimes (ie do 2 things at once). Multiple loops are a pretty common use-case
useful* whoops lol
Wait, do you want the background color to change or just the text?
i got it to work for me both ways,
i see, thank you
bg + i changed it but i get this color for some reason
If you want an easier format for color, I'd recommend Color3.fromRGB()
Hm, I got a bright red.
idk why
i tried BackgroundColor and BackgroundColor3
Can you post your code?
What did you do inside the code?
What's the difference between ProductID and assetID
I have no clue 🤷
GuiButton.Text = "On"
GuiButton.MouseButton1Click:Connect(function()
if GuiButton.Text == "On" then
GuiButton.Text = "Off"
GuiButton.BackgroundColor3 = Color3.new(255,80,80)
script.Parent.Parent.HUD.Canvas.Currency.Visible = false
else
GuiButton.Text = "On"
GuiButton.BackgroundColor3 = Color3.new(55, 255, 0)
script.Parent.Parent.HUD.Canvas.Currency.Visible = true
end
end)
sorry is this question is stupid
Use Color3.fromRGB with those values, Color3.new() is in a different format
yeah
in terms of what
assetsId you get it from the creator hub for me i add it in local called productId so pretty much they are the same just diffrent names i think
1 sec
but what's the difference between PromptProductPurchase and PromptPurchase
same problem
Is the code similar to:
GuiButton.BackgroundColor3 = Color3.fromRGB(255, 80, 80)
?
it darkens again idk why
Can you post your updated code? It might just be the wrong color values, but I'd like to make sure
GuiButton.Text = "On"
GuiButton.MouseButton1Click:Connect(function()
if GuiButton.Text == "On" then
GuiButton.Text = "Off"
GuiButton.BackgroundColor3 = Color3.fromRGB(55, 255, 0)
script.Parent.Parent.HUD.Canvas.Currency.Visible = false
else
GuiButton.Text = "On"
GuiButton.BackgroundColor3 = Color3.new(55, 255, 0)
script.Parent.Parent.HUD.Canvas.Currency.Visible = true
end
end)
The second one is still Color3.new(55, 255, 0) instead of Color3.fromRGB(55, 255, 0), changing that should fix it
local GuiButton = script.Parent.Settings.Frame.GuiButton
GuiButton.Text = "On"
GuiButton.MouseButton1Click:Connect(function()
if GuiButton.Text == "On" then
GuiButton.Text = "Off"
GuiButton.BackgroundColor3 = Color3.fromRGB(255, 55, 0)
script.Parent.Parent.HUD.Canvas.Currency.Visible = false
else
GuiButton.Text = "On"
GuiButton.BackgroundColor3 = Color3.new(55, 255, 0)
script.Parent.Parent.HUD.Canvas.Currency.Visible = true
end
end)```
like this?
Look at the one after the else statement, see how your using Color3.new instead of Color3.fromRGB?
oh yeah
nah didnt solve anything
nothing can fix this script
i aint dying before i fix it
Lol don't crash out I'm sure it's a simple fix, to clarify, both are using Color3.fromRGB?
yup
GuiButton.Text = "On"
GuiButton.MouseButton1Click:Connect(function()
if GuiButton.Text == "On" then
GuiButton.Text = "Off"
GuiButton.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
script.Parent.Parent.HUD.Canvas.Currency.Visible = false
else
GuiButton.Text = "On"
GuiButton.BackgroundColor3 = Color3.fromRGB(55, 255, 0)
script.Parent.Parent.HUD.Canvas.Currency.Visible = true
end
end)
like the thing is
wait lemme rec
Then it should work, assuming you're changing the color of the right thing.
inside the button
StarterGui
Would play the video but my internet is refusing to load it
We've all had the script that doesnt work properly without throwing errors
But what about when the script throws an error and still works anyways
discord is trash at loading vids
happenes,act like u are blind 
Its not even discord as my internet has been randomly turning off
if an error isn’t interfering with the script then the bugged part probably isn’t necessary for the script to function anyways
This may sound stupid but maybe just save the place, then restart studio?
But thats the thing, It doesnt work when I remove the error part. Ill show a image, one sec
Assuming you're referring to everything properly, and another script isn't overwriting it, I think it should work assuming the code you've shown is what you're using
lemme try
The second part is kinda important, make sure you don't have another script changing the color
what kind of error does it say it is when you hover over the red squiggly line
There might be one you've forgotten about or something affecting the color
if there’s an error in syntax or something isn’t properly defined and whatnot studio will tell you where the error is
Try changing the red to a different red
That could work too, colors can be finicky for some reason
Same problem
I tried every color you could think of
All are dark
if the error is on run you can do /console in testing to see what pops up in the logs
I have a theory wait
Something else must be overwriting it maybe? Try putting this in a script to see how it changes color
local button = (button location goes here)
button.Changed:Connect(function(prop : string)
if prop == 'BackgroundColor3' then
print(button.BackgroundColor3)
end
end)
Oh neat, do you know what the issue was?
The goddamn ui gradient
Nah
I can’t tolerate dis
I was close to be laying down with my ancestors
Or doing schedule 1 irl and quitting scripting
Sorry, edited image became unreadably small res.
The line of code was
Animation.Ended:Connect(SoundEffect:Play())
When it's blocked out, the sound doesnt play.
When left in, script throws an error: Attempt to connect failed: Passed value is not a function but plays the sound anywasy and follows through with the rest of the script 😂
That's weird, but if you get rid of the () after play it might work?
Thats the thing, it works anyway
I mean yea but you should probably want to get rid of the warning
Fascinating little creature this engine is
thank you @cosmic olive
Could also do:
Animation.Ended:Connect(function() SoundEffect:Play() end)
if that doesn't work :P
U wasted ur time cuz of my lack of attention
Lol np I've been working on stuff in the meantime anyways
Will attempt
@halcyon fulcrum This
Oh the problem was cuz of sfx?
Which, doesnt work for my specific case since for some reason the function yields until I release the mouse button, as the rest of this code block repeats on a loop until the mouse is release, so a strange interaction there
x. x
What is the best way to script the destructive effects of an anti material bullet
I scripted an ntw 20 along with a scar L and m4a1
I just need to implement the destructive aspect of the anti materiel rifle
It’s for my application for luau programmer
You'd probably need to design a map with it in mind, or dynamically make a function to split up parts that it hits and change the anchor property of them
Is using explosions efficient
Generally, you want the destructible mesh/part to already have it sliced into it's broken pieces, then have the pieces fall off as they're impacted
Former is kinda annoying but easier to think about, latter is much harder to make but is easier to work with (you don't need to really think about it)
To be honest I never recommend using the built in roblox explosions, they're kinda bad
Yeah I was thinking that too
Explosions have a lot of wierd interactions with anchored vs non-anchored parts,
Can definitely work though if you're building a classic style game or don't really care about the effect that much
A custom thing will pretty much always be better though lol
I like putting effort lol I don’t like making cash grabs it’s no fun
I've spent the past like 4 days making a door for my game lmao
That's that grind
It just has like 50 properties I have to deal with and it's really modular
Better to get the logic out of the way now then deal with it later
These are the entities I will be testing the antimateriel on
I scripted them to have green cores / weak points where they can die if the core integrity becomes critical
Those skeletons are sick, that's really cool
Can someone help me understand what i'm doing wrong, the part does not move.
this is the full script:
local part = game.Workspace:WaitForChild("Part")
local dragDetector = part:WaitForChild("DragDetector")
dragDetector.DragStyle = Enum.DragDetectorDragStyle.Scriptable
local lastViewCFrame = CFrame.new()
dragDetector.DragContinue:Connect(function(player: Player, cursorRay: Ray, viewFrame: CFrame)
lastViewCFrame = viewFrame
end)
dragDetector:SetDragStyleFunction(function ()
local frontPosition = lastViewCFrame.Position + (lastViewCFrame.LookVector * 10)
return CFrame.new(frontPosition, frontPosition + lastViewCFrame.LookVector)
end)
... but if i put
local frontPosition = lastViewCFrame.Position + (lastViewCFrame.LookVector * 10)
part.CFrame = CFrame.new(frontPosition, frontPosition + lastViewCFrame.LookVector)
Inside the dragDetector.DragContinue the part moves.
Ty bro
You’re not actually moving the part in your script. SetDragStyleFunction only tells Roblox how the drag should behave—it doesn’t automatically update the part’s CFrame. You need to set part.CFrame manually inside DragContinue, like in your working test.
Does that make sense to you?
I think you don't need to do stuff in the .DragContinue event if you change the DragStyle to Scriptable, but I'm not 100% sure since I've never used those before lol
That’s odd
Make sure DragStyle is set to scriptable
yes it is
Hm
Wait I think I know what’s going on
Your function here
dragDetector:SetDragStyleFunction(function ()
local frontPosition = lastViewCFrame.Position + (lastViewCFrame.LookVector * 10)
return CFrame.new(frontPosition, frontPosition + lastViewCFrame.LookVector)
end)
It’s using stale data from lastViewCFrame, which only updates during DragContinue. But SetDragStyleFunctio runs before DragContinue fires—so lastViewCFrame is outdated and maybe even CFrame.new() (the default) when drag starts.
🤔
You need to use the parameters passed into SetDragStyleFunction, like this
dragDetector:SetDragStyleFunction(function(player, cursorRay, viewFrame)
local frontPosition = viewFrame.Position + (viewFrame.LookVector * 10)
return CFrame.new(frontPosition, frontPosition + viewFrame.LookVector)
end)
Now it uses fresh data every frame
I may be wrong
nah you're onto something
I think you probably should use the passed values, but I think with the pre-existing code it should've done something, right..?
YO keyframes keyrames bezier curves ahahahahahaaa.
Tbh the position being updated like that is kinda weird
he is right SetDragStyleFunction is being called first
no the pre-existing code doesn't work the part doesn't move at all
i'll try to understand how i can use the cursorRay which is passed into the DragStyle function to move the part instead
Yea good luck, seems kinda weird to set up lol
why does my pathfinding ai stops working properly after a few mins?
We need more info than that
I don't understand this....
part.CFrame = ... WORKS! the part is following my cursor just like i want it to but if i remove it the part doesn't move at all
dragDetector:SetDragStyleFunction(function (cursorRay)
local finalPosition = cursorRay.Origin + cursorRay.Direction.Unit * 8
-- part.CFrame = CFrame.new(finalPosition)
return CFrame.new(finalPosition)
end)
that's not supposed to be the case
and i can't just leave part.CFrame = ... because then the part just says in the position it was left
this is what happens
dm me if you're a high quality scripter looking for a building partner tryna launch a game studio (I have 4 years experience, contributed to 10m visits, ~2m of my own).. I have robux to invest if worth
Who’s a good scripter
That looks pretty cool! Maybe a way to add more time to one, or clone a timer?
Me
I’m trying to implement a knockback effect here when the anti materiel bullet hits the entity. Is it better to use a bodyvelocity/vector force or is there some other way?
Is it better to use HumanoidRootPart:ApplyImpulse()?
I would stick to some sort of force instance
Alright
Although it's not super difficult to just tween the body back a bit, it might interfere with the movement scripts so I'd avoid that unless you don't want them to move while being knocked back
Honestly there's a bunch of ways to do it
Kinda just depends on how you want it to 'feel'
alr i need help icl
how tf do i check if the textbuttons name is == a dicionary in Codes
Hi, you can do
for _, code in ipairs(BackgroundFrameGetChildren()) do
if Codes[code] ~= nil then
-- stuff
end
end
You should use 'ipairs
Sorry, ipairs is best used when it's not a dictionary, it's more optimal
oh
And getchildren() returns a table, so it's indexed in order
It's not super important, a very minor distinction
Are you sure the function is running?
Just to clarify, you're code is:
if Codes[v.Name] then
print(Codes[v.Name])
end
Right?
I'm assuming there's stuff inside of the frame named properly?
Lol no worries
it worked now i forgot v.names in the top
I promise I'm not lol
alr lmfao
Kinda hurtful 😢
Lol just a habit, I like how it looks ;P
Mood tbh
Oh nice, I like how that looks :D
Getting weird problem where my return value(A dictionary) turns into a string along the way.
Got no idea how this is happening 😭
I think it might be related to the return value of:
result, Data = pcall(module.playerStore.SetAsync, module.playerStore, PlayerWrap.Owner.UserId, Data)
Not 100% sure since I've no idea what those do, but it's possible that's setting Data to be a string (Looks like the user id, maybe?) instead of the data
Thats what I initially thought to but after placing a couple breakpoints and looking at the watch the pcalls seem to return just fine
I'm assuming the :ConnectPlayer() method is shown in the first image?
yes sorry it was a bad screenshot
Lol no worries, are you sending the tables over a remote event or the like? Those have weird behaviors with dictionaries, if I remember correctly
Nope I am just using requiring a module script(called datastore) and using its ConnectPlayer function
both are serverside
Oh boy
How would I make a scope HUD for a sniper rifle that zooms in on the 2d area of the scope but is normal outside that area?
Are there any other returns for that function or is just the one?
ViewPortFrame im guessing
This seems next to impossible
This is a really difficult problem, other than replicating it with a viewport frame (or replicating the outside with a viewport frame) I don't think it's possible
It would look horrible
🥀🥀🥀
yeah obviously
Its just that one data value
but u can use z index
I thought about capture service but that wouldn’t work either
and js make abunch of frames around it to get that scope effect
I know
Is it possibly an issue with the input, rather than the output?
But I wanted something more realistic
If only you could use capture service with cframes 💔🥀
it would be realistic or as realistic as roblox uis could get
Here ill poke and prod a little more and then respond if i discover anything or solve it
Yea sorry I couldn't give better help, that's a really weird problem lol
Yep its came outta nowhere 
a
It was this line here. It was returning the version identifier of the SetAsync function. It would sometime work sometimes wouldnt so thats why I was getting mixed results.
Ah, yea, glad you were able to figure it out :D
Is it bad I use ChatGPT to fix 99% of my codes and of course just to make them
could be 100%
No not necessarily
You should probably avoid using AI if you want to improve as a programmer, if you're learning anyways
Agreed
I don’t know how to code cuz I have dyslexia it kind of makes it hard to learn, and then I also have ADHD on top of all that
My good friend has been coding for 10 years with ADHD
Oh yeah, and when I try, I get chronically stressed
That's certainly fair, and I empathize with your struggles, but using AI won't help you program, it will just program for you. If you want to improve, there's other ways to work around those issues
Multiple languages also
And is coding the only thing you want to do?
I mean, I can read the code and understand it but, when it comes down to making it mentally I get lost and yeah
Like I do sfx and music
No I am a builder mainly I also have to learn code because I’m making a game
So of course, I have to become full stack
Why ya don't have any roles for it den
Bc I never applied for it and I like to be humble about what I can do
I think that's an issue most people struggle with tbh, but I find with complicated issues, writing out the logic and going through it helps a lot
Hm
How long you been sxrutoif for
Bro I'm to tired
Stroke moment
You get what I mean
If you mean scripting, then yea lol, I've been scripting for around 10 years or so
Ah ok
Only got good the past like, 2-3 though :P
xD
Being a builder is like Legos, but understanding code is pretty damn foreign to me
(since I’m good at making my own LEGO builds without instructions of course Roblox was easy as 123)
Maybe there’s some software that can make it like LEGO build For the coding
I'm know how to code basic things, but it's not what I focus on
Would ye ever do commissions?
Yes
I need a cave map really badly
But my style is kind of from SCP genre, so maybe that might work
Due to the fact I'm a sfx guy and we have 2 animators, 3 scripters and 1 ui
Ah ok
Bru can I change my roles
Hm
Yes
How much would you do
Elaborate
How much would I have to pay you to make a map
I’m not the best at pricing
Dm
a
B
Anyone good with blender and rigs in here? I have been through a couple different experts and cant seem to get my models importing into roblox correctly. Would be happy to compensate for your time if you can point me in the right direction. Thanks.
have u checked if it's over 10k trigs
whats the error look like or what does it look like when u actually import it
i want to move a brick object around a sphere, but i also want it to be warped to surface of the sphere, how would i do this?
a little math or a little raycasting*
math would be preferable
how u do dat
if u mean something like cloth simulation when you say "warped to the surface" then i can only think of custom mesh. i personally havent dealt with such things
yo bruh @soft marsh whar up
Someone please tell me how i have statemanager module and i handle all state checks and sets on the server for all scrips however somehow all my moves are breaking into eachother and destroying the game if i can fix this one thing i can progress
instead of writing comments like this
//Comment
you had to write your comments like this
using Comments;
public static comment Reasoning()
{
return /*This if statement is damn useless*/;
}
Comments.UseComment(Reasoning);
if (true)
{
}
opinion?
opinion on what? lol
did you see the message before it
no i must have missed it
@pine solstice so like I made something, dms
rate
y'all is it ok if i give a scripter 30%?
95% at least
...
the scripting is simple dawg.
it will only take a god scripter about 1 hour to complete task]
and they get 30%
hey evering one
i need help in a code that is a bit scuffed
if anyone is willing to help for free id love if u could DM
its a rlly small code that i cant debug
How much would it be for a Sword System, with Framework, M1 Combos, Parry, all that stuff
30k robux?
60-80k
js post it here huh
Aight

