Stop Repeating Yourself! Improve Your Code with Collection Service

  Рет қаралды 54,580

GnomeCode

GnomeCode

Күн бұрын

Get the plugin here: www.roblox.com...
MERCH ► shop.gnome.codes/
DISCORD ► / discord
TWITCH ► / gnomecode
TWITTER ► / gnomecoderblx
WEBSITE ► gnome.codes/

Пікірлер: 242
@galicate
@galicate Жыл бұрын
Should be noted that you no longer need the CollectionService plugin, as it has been officially added to roblox in the View tab.
@ImMrGrape
@ImMrGrape 5 ай бұрын
It makes it easier with the world view
@robertitoOFC
@robertitoOFC Жыл бұрын
Do a Tower Defense again plssssssssssss
@jhkz
@jhkz Жыл бұрын
Thank you so much! It's really annoying to copy & paste every single line of code a lot of times.
@GnomeCode
@GnomeCode Жыл бұрын
Glad it helped!
@KoalaKrush
@KoalaKrush Жыл бұрын
First! Nice video
@liame3441
@liame3441 Жыл бұрын
How did you watch this video in 1 minute
@KoalaKrush
@KoalaKrush Жыл бұрын
@@liame3441 s k i l l s
@bloxthebloxxer8234
@bloxthebloxxer8234 Жыл бұрын
NOTE: if you encounter bugs with it try to make sure none of the variables you are making are global because that really messes with everything alot
@_snekmatt-xt5ch
@_snekmatt-xt5ch Жыл бұрын
Outside the loop or in?
@coreydorce8246
@coreydorce8246 7 ай бұрын
Generally anywhere, you shouldn't use global unless you have to reference it in another script for some reason
@fourone1254
@fourone1254 Ай бұрын
@@coreydorce8246module scripts negate that
@Ph4ntomize
@Ph4ntomize Жыл бұрын
These are the habits that more people should be spreading awareness of.
@neut_ro
@neut_ro Жыл бұрын
I found you here too?! Cool
@schloomy
@schloomy Жыл бұрын
oh hey ph4ntomize
@Cogrem
@Cogrem Жыл бұрын
Oh hey
@findrandomshithere
@findrandomshithere Жыл бұрын
dear sweet jesus you're alive
@12Duckz
@12Duckz Жыл бұрын
Gnome always with a helpful video, keep up the good videos man.
@GnomeCode
@GnomeCode Жыл бұрын
Thank you!
@King_NaymarosReal
@King_NaymarosReal Жыл бұрын
​@@GnomeCodecan you show how to use messaging service i want to make global shop stock, and wonder how it works. Hope you will help
@ran2140
@ran2140 Жыл бұрын
1
@Euphoric987
@Euphoric987 Жыл бұрын
Gnomecode make chapter 5 man I beg you make chapter 5 I LOVE YOUR GAME MAKE CHAPTER 5😢
@Aiden_gue
@Aiden_gue Жыл бұрын
omg omg omg omg ty ty ty ty
@Silly_Genius
@Silly_Genius Ай бұрын
If you have multiple server script, it is highly recommended to tween the doors in client side and not server side for performance and efficiency
@SafixBG
@SafixBG Жыл бұрын
Hello! you can make a tutorial on how to make Doors HOTEL UPDATE in roblox studio
@hooppss
@hooppss Жыл бұрын
Could you do a tutorial of a turn based system? I've been looking for some a long time.
@PizzaMoose
@PizzaMoose Жыл бұрын
I agree! It would be so cool to learn how to make one!
@phazeyt
@phazeyt Ай бұрын
Ty so much I’m learning to script and I’m in the middle of making a game and this helps a lot with optimization
@JDV333
@JDV333 Жыл бұрын
can you make a how to make jojo game?
@pelletsstarpl8985
@pelletsstarpl8985 Ай бұрын
Any way to make collection service execute when new part with such tag gets added to a workspace?
@GigaGnome
@GigaGnome Жыл бұрын
Upload grind recently.
@grinderandrew
@grinderandrew 10 ай бұрын
question:how do you make the sliding door is it in the toolbox?
@SHOIOTERB
@SHOIOTERB 8 ай бұрын
There can be grammar mistakes so I hope you know how to fix my grammar (Put the Tween:Play() somewhere in a function like Script.Parent.ProximityPromt.Triggered:Connect(function() Tween:Play() end)
@B00PZIES
@B00PZIES 7 ай бұрын
I’ve been using another method such as grouping the similar models together, and looping through them all. Is it better to use collection service? Is there issues with my method?
@ReeeMonke
@ReeeMonke 3 ай бұрын
I have a question, what if I wanted to change one thing on each of these? Ex. A button has a unique variable that only it has
@MAXFOLLch
@MAXFOLLch 8 ай бұрын
it is not handy to use this trash bro, it is useful but hard to understand, why we need plugins, fucked that, bro you can just disable script and clone it into your same objects
@computerheadman1601
@computerheadman1601 5 ай бұрын
No one is gonna mention the creator named sweetheartichoke xd?
@threasto
@threasto Жыл бұрын
I never use collection service enough, but it is pretty handy. I personally just throw any object of a certain type (ie doors) into a folder called doors and loop through them instead
@MarzFromMars
@MarzFromMars Жыл бұрын
Same
@AverageFries
@AverageFries Жыл бұрын
same
@treyg5265
@treyg5265 11 ай бұрын
same
@thestrongest45
@thestrongest45 10 ай бұрын
Not very convienent, in my situation i have to use over 5 for loops..
@itz_ult
@itz_ult Жыл бұрын
There’s a different way I like to do it using folders
@Gavriasagmaeilll
@Gavriasagmaeilll 11 ай бұрын
i suggest not trying to use workspace as a whole, because player models will exist in there too, and if their displayName is the same as a tag...then that changes a lot about the player in question
@FINDROBLOX
@FINDROBLOX 4 ай бұрын
??? Bro what they don't have the tag themself it's just their display they don't have a tag value
@Gavriasagmaeilll
@Gavriasagmaeilll 4 ай бұрын
@@FINDROBLOX didnt know at the time, lol
@Kitoucher
@Kitoucher Ай бұрын
What if i need to put while loop in a ton of parts?
@NotMrducky
@NotMrducky Жыл бұрын
Can you make a tut On how to Make a Tds Game??
@thingytb7458
@thingytb7458 Жыл бұрын
he already did
@NotMrducky
@NotMrducky Жыл бұрын
@@thingytb7458 I Mean like a New Tut Sense this one does not work
@chillgamer3485
@chillgamer3485 Жыл бұрын
Hey GnomeCode, could you show us how to make a turn based fighting game similar to Adventure Story? It would be awesome!!
@gavinhoh7218
@gavinhoh7218 5 ай бұрын
How do you do this with zombies
@unifores
@unifores 7 ай бұрын
Any other game engine makes that automatically for everything...
@somedude0001
@somedude0001 6 ай бұрын
Roblox is pretty flawed
@jimikalliopuska9421
@jimikalliopuska9421 Жыл бұрын
Please finish the doors series
@exoticyy
@exoticyy 3 ай бұрын
Help I want to put a tween in it
@kingofgameing107
@kingofgameing107 Жыл бұрын
this video is so helpful
@icetea622.
@icetea622. Жыл бұрын
Updated tower defense code!
@RobloxTutorialsITA
@RobloxTutorialsITA Жыл бұрын
where are new tutorials on how to do games?
@Marioman73
@Marioman73 Жыл бұрын
These give you the building blocks / tools to make games!
@abyssguardian
@abyssguardian Жыл бұрын
These tutorials provide the building blocks for a game. You're the one who makes the game! Use these as steps if you need to. Hopefully you can create yourself a fun game!
@Fezjk
@Fezjk Жыл бұрын
please make a rts game tutorial
@A10PlaysGames
@A10PlaysGames Жыл бұрын
bro said no doors
@_snekmatt-xt5ch
@_snekmatt-xt5ch Жыл бұрын
Its not workimg...
@buuild
@buuild Жыл бұрын
I don't use collection service, nor do I use dupe scripts. Instead I put them in a folder and for the loop I do folder:get children instead of collectionservice:get tagged but both work
@xgodtoxi2978
@xgodtoxi2978 Жыл бұрын
same
@GnomeCode
@GnomeCode Жыл бұрын
This works well until you want to organise your folder structure differently. What if your doors are inside a building? You would probably want them to be inside the folder/model for that building rather than in their own separate doors folder. CollectionService allows you to easily access all the tagged elements rather than relying on a specific folder layout.
@buuild
@buuild Жыл бұрын
@@GnomeCode ooo good point imma start using this
@KingDuckTheGreat
@KingDuckTheGreat Жыл бұрын
I was doing this too but now that I know this exists I will be using collection service
@RealRavaYT
@RealRavaYT Ай бұрын
What does scipt.Parent mean?
@oleNikolic
@oleNikolic Ай бұрын
It basically means the object that you put the script into, for example if you put a script into a part the script.Parent would be the part,and the script would be called the ‘Child’ of that part. If you are new to scripting and you think you are ready and smart you can always learn to script,as there are many tutorials out there on KZbin! 😊
@CallMe_Noah
@CallMe_Noah 3 ай бұрын
You can also use the "for" syntax as an alternative to collection service, as you can multitask with it and it's very simple and not complicated at all to use. CollectionService is still pretty good though, but I prefer "for".
@PorscheViveLatte
@PorscheViveLatte 5 ай бұрын
This video saved me from copy and pasting 840 times thank you so much 😊
@bradleywhais7779
@bradleywhais7779 9 ай бұрын
I learned you dont need pairs() or ipairs() anymore because luau now has general iteration. :(
@Someone-df3tv
@Someone-df3tv 11 ай бұрын
Exactly what I had been searching for. Thank you!!
@Pylia_Play
@Pylia_Play Жыл бұрын
ей гном плис донат
@yes.5110
@yes.5110 Жыл бұрын
how to make a purchase prompt for catalog items and clothes appear when text button gui is clicked
@Puzzledmusel86
@Puzzledmusel86 Жыл бұрын
I never knew what this was before this video :)
@nikushahd
@nikushahd Жыл бұрын
Thx
@PorscheViveLatte
@PorscheViveLatte 5 ай бұрын
This video saved me from copy and pasting 840 times tysm
@broko151
@broko151 Жыл бұрын
Its helpful this thanks
@guardian3061
@guardian3061 Жыл бұрын
pon
@devuskasolnce21
@devuskasolnce21 Жыл бұрын
hey bro nice video !!! but by the way remember ? about doors ? you made the last episode is 7 about how to make doors in roblox studio so maybe you should continue making video about how to make doors in roblox studio ?
@sadge6430
@sadge6430 7 ай бұрын
8u
@SHOIOTERB
@SHOIOTERB 8 ай бұрын
Thank you very much, now I can make my Sci-Fi doors of my game work on that
@rtralph1269
@rtralph1269 11 ай бұрын
Okay so, what makes me mad is that you didn't explain the for loop for this particular topic. Can you please tell me how that works for CollectionService?
@Nahwap
@Nahwap 11 ай бұрын
it basically gets every instance (doesn't matter if they are in the ServerStorage, ReplicatedStorage, Workspace, etc) with the tag you are looking for. For example, it's very good if you want to handle AI's because you dont need a single script inside every npc or every npc inside a single folder
@Nie_powiem
@Nie_powiem Жыл бұрын
Hey gnomecode how to we use collection services on kill parts?
@Trollmonster3
@Trollmonster3 Жыл бұрын
Is there any way to make this A touched function?
@thatyoutubeguy-md2ws
@thatyoutubeguy-md2ws 5 ай бұрын
Bro, I needed This Tutorial ♥ it took me so long to find a good tut like this one 💀💀💀💀
@Objrbo
@Objrbo Жыл бұрын
you can make a tutorial on how to create a boss fight like the ones in item asylum
@tedbasher3000
@tedbasher3000 Жыл бұрын
I usually just handle it on the client via a local script. However one time I was making a FE2 game, and in that one I just put a script that loads a module script with the code
@t_ownscaper
@t_ownscaper Жыл бұрын
114
@gerjovogelfotografie5826
@gerjovogelfotografie5826 8 ай бұрын
How does the script knows what ''model'' is? (parameter on 4:55)
@Arab_GameZone1
@Arab_GameZone1 8 ай бұрын
Because you told it to look at any model that has sliding door tag
@Arab_GameZone1
@Arab_GameZone1 8 ай бұрын
Also "model" is a variable so you can change it to what ever you want like name it "door"
@Arab_GameZone1
@Arab_GameZone1 8 ай бұрын
Sorry i thought you asking about the model that is in the for loop, in the parameter because you add the function movedoor to the for loop and told the script that you want it to work on the model and isopen using the parameter
@thew219
@thew219 Жыл бұрын
How do you see the tags of an instance without a plugin? I use custom attributes and check its value for scripting. I can see attributes on the properties panel but idk where to easily find tags without plugin.
@harrow7533
@harrow7533 11 ай бұрын
what about For i loops you could also use that
@PhantomsCreations
@PhantomsCreations Жыл бұрын
Gnome sir you explain so good but how do you have so much less subs you should reach 1 million!
@ahmetselimgt3232
@ahmetselimgt3232 11 ай бұрын
More of this series please
@furantsu1
@furantsu1 Жыл бұрын
I’m going to use this for UI button sounds. Thanks!
@DrizzyB
@DrizzyB 10 ай бұрын
Can someone explain the original moving door script to me, specifically the "function MoveDoor(isOpen)" thing? I'm not understanding the argument of "isOpen" and how it's pertaining to the function. I know that arguments send information that is out of scope of a function to said function, but what information is "isOpen" sending? Does the "isOpen" attribute need to be applied to the model in order for the door to move? What about when the attribute is set to "not isOpen" after the proxim prompt is triggered? The door can still be moved after it's opened (closing the door). What does "local isOpen = model:GetAttribute("isOpen")" even mean?
@gunipotys
@gunipotys 10 ай бұрын
If the door should be open or not, if it should, then it reacts a way, if it shouldn’t, then it react another way. Also, the last line just get the value of the attribute.
@georgepg3d854
@georgepg3d854 8 ай бұрын
Its advanced scripting stuff and it seems like you dont understand it,but dont worry just practice more!And believe me studying better is better than studying more,so if you find scripting tutorials that you perfectly understand youre good to go!😊
@Likeable_Emmec
@Likeable_Emmec Жыл бұрын
unironically saved me a huge headache
@LeapInno
@LeapInno 10 ай бұрын
Ohh now this makes more sense.
@FidLine1erDunom
@FidLine1erDunom 10 ай бұрын
Thank for the video
@yeetmanmega
@yeetmanmega Жыл бұрын
are you back from your break?
@Yan-ol4qu
@Yan-ol4qu 7 ай бұрын
OH MY GOD I LOVE YOU.
@PizzaInSpace
@PizzaInSpace Жыл бұрын
One of the early people!
@twinn61661
@twinn61661 Жыл бұрын
The tag editor plug in is no longer needed. Robots add a tag instance in the properties window.
@chibisayori20
@chibisayori20 Жыл бұрын
"Robots" lol
@twinn61661
@twinn61661 Жыл бұрын
typo I meant Roblox, :)@@chibisayori20
@RansomwaveRBLX
@RansomwaveRBLX Жыл бұрын
didn't know about that, thank you man!
@Spork2
@Spork2 Жыл бұрын
Thank you GnomeCode. I’m currently making a game and you have no idea how helpful this is 😅
@zellpoxio
@zellpoxio 8 ай бұрын
thanks
@demtix4381
@demtix4381 Жыл бұрын
Thanks for making this
@urosmaricic5628
@urosmaricic5628 Жыл бұрын
GnomeCode can u pls make the TDS tutorial 2023??? Pls 😭😭😭😭😭😭😭😭
@mmd4369
@mmd4369 Жыл бұрын
This is actually sick! Gnome, how did you learn coding?
@toadwithtoes
@toadwithtoes Жыл бұрын
i would just use a module script for all the doors to share.
@chibisayori20
@chibisayori20 Жыл бұрын
"NO I REFUSE TO TOUCH MODULESCRIPT I WILL NOT USE OOP. LONG LIVE REGULAR SCRIPTS!!" - A regular script purist probably.
@toadwithtoes
@toadwithtoes Жыл бұрын
@@chibisayori20 lol, but then wouldn't you repeat ur code?
@chibisayori20
@chibisayori20 Жыл бұрын
Just copy and paste them, or use Package system to make the door a package, so if you change the door's script, and update the changes it should update all doors in the place. You could also put the door in a storage service (ReplicatedStorage or ServerStorage) and clone them to a position on the map.
@miles1094
@miles1094 Жыл бұрын
It makes more sense to have your scripts either in server script or player scripts. They should never be in a model. It keeps things organized and maintains a good workflow
@chibisayori20
@chibisayori20 Жыл бұрын
@@miles1094 So how about NPCs? Do i have to use OOP or even use for loops to make something like a enemy NPC that shoots you with a weapon? I can understand AI navigation, but what about aiming, shooting weapon, and all that misc stuff? 99% of NPCs with weapons i came across in toolbox have their scripts inside the model, and yeah sure non roblox NPCs are handled differently like they have seperate classes for them, like behavior, weapon handling, etc but this is roblox
@mysyvcic
@mysyvcic Жыл бұрын
​@@chibisayori20I use CollectionService and ModuleScripts for my AI's, and when I did a stress test with 30 of them i mostly get 45-50 fps and my PC is pretty much a low-end pc. And when all my AI's had separate scripts it made me get 20-30 fps.
@mysyvcic
@mysyvcic Жыл бұрын
​@@chibisayori20Plus my AI's can actually attack
@PolyTheDude
@PolyTheDude Жыл бұрын
@@chibisayori20 That doesn't mean theyre good 99% of those npcs are outdated and not very optimized Now you could have scripts in your npcs and still have them optimized, but generally itd just be better to have one script manage multiple npcs instead of multiple scripts managing their respective npcs Aiming, shooting, etc, just use modulescripts brah
@Homeannor
@Homeannor Жыл бұрын
This is literally game changing! Just the other day I was wondering if Roblox has some sort of system similar to Unity Prefabs where you can just edit 1 and it would edit all of them. But now I know! ~~After almost 8 years~~ _Now I just have to go and implement this change... Oh god..._
@ContentDeletedv1
@ContentDeletedv1 Жыл бұрын
Gnomecode is there anyway you could help me with your teddy series? I followed the 1st video and the animation wont work I tried it a different way that worked but the the players animation wouldn't work
@complexcrimes
@complexcrimes Жыл бұрын
I have been wondering how do this for the past few weeks this will help SO MUCH
@LucaszYT_Ofc
@LucaszYT_Ofc Жыл бұрын
Gnome, i really want to make a game like zombie Attack and zombie Rush.. Can you make a tutorial series about this please? I really want for example an episode about How to make a unique Boss for each map
@the_yelo
@the_yelo Жыл бұрын
Thank you mr gnomecode!
@ANSU12321
@ANSU12321 Жыл бұрын
This video really helped with my original simulator
@jukepilot
@jukepilot Жыл бұрын
Mr Gnomecode, you should make a video about making lore!
@sebalby34
@sebalby34 Жыл бұрын
... bro lore is a story element in your game, u dont need scripting for lore, lore is story and you decide it, u dont need a tutoeial to make up a story
@eronimlol
@eronimlol Жыл бұрын
GnomeCode, why you using a plugin for tagging objects? Roblox studio have their own simple tag editor.
@chibisayori20
@chibisayori20 Жыл бұрын
so he can infect his place with viruses
@miffclick3358
@miffclick3358 Жыл бұрын
Python To Roblox To Skidibi Da Da Doo Skibidi Di Daw
@Daani_Duarte
@Daani_Duarte Жыл бұрын
Hey gnome, could you explain why do you use "isOpen" and "Close" or "Open" for proximity prompt text? Im assuming isOpen is a boolean attribute, but how does this works? The same happens at the color... Is it because, since its a boolean, if its true it will get the first parameter otherwise get the second? Appreciate, Thanks.
@kristof0713
@kristof0713 Жыл бұрын
or gives you the first value if its not nil or false and the second otherwise. true and "close" or "open" will give you close becuase true and "close" are both true values false and "close" or "open" turns into false or "open" because false and true -> false and if the first value is false or gives back the second one Idk if this made any sense Its lua's ternary operator
@Daani_Duarte
@Daani_Duarte Жыл бұрын
@@kristof0713 I see... Ty, now it makes sense!! =D
@emiliogamerr9723
@emiliogamerr9723 Жыл бұрын
Can you pls make a tutorial to make an rpg ty
@JoseRomero-ew2hn
@JoseRomero-ew2hn Жыл бұрын
Can you do hungry pig i've been waiting over 6.5 months for you to make the tutorial series and it's making me bored and tired of waiting and I want to see it right now I'm not good at waiting for stuff you know that!
@Sleep-f1w
@Sleep-f1w Жыл бұрын
He is bad at waiting
@TheWijss
@TheWijss Жыл бұрын
thanks its so usefull
@spngrg99
@spngrg99 Жыл бұрын
will you continue the Noors tutorial? are you planning on make other tutorials also?
@sebalby34
@sebalby34 Жыл бұрын
Noors
@VeryProPlayerYesSir1122
@VeryProPlayerYesSir1122 Жыл бұрын
@@sebalby34 *Doors
@guygameguy5548
@guygameguy5548 Жыл бұрын
This is so helpful!
@FearlessSloths
@FearlessSloths Жыл бұрын
hey any of you know how to get the player to rotate based on the rotation of a part the player is standing on?
@GnomeCode
@GnomeCode Жыл бұрын
Use Cframes!
@FearlessSloths
@FearlessSloths Жыл бұрын
@@GnomeCode bro you actually responded, i didn’t expect it would happen, me and my friend know its in derelict but, a question is would you know how to make a local script which prob has multiple scripts or not, if you do know can you try to make a vid or reply to this comment with a script, not needed but if you can then can you do it?
@FearlessSloths
@FearlessSloths Жыл бұрын
@@GnomeCode also i have a question, im trying to make a horse but cant find any tutorials if you could make one i will be thankful
@madzhis7076
@madzhis7076 Жыл бұрын
Very useful, ive had enough of changing scripts in 20 different models
How to Secure your Game Against Exploiters
28:30
GnomeCode
Рет қаралды 71 М.
What are Module Scripts? Roblox Scripting Explained
8:04
GnomeCode
Рет қаралды 149 М.
Остановили аттракцион из-за дочки!
00:42
Victoria Portfolio
Рет қаралды 3,8 МЛН
Nastya and balloon challenge
00:23
Nastya
Рет қаралды 68 МЛН
The selfish The Joker was taught a lesson by Officer Rabbit. #funny #supersiblings
00:12
规则,在门里生存,出来~死亡
00:33
落魄的王子
Рет қаралды 24 МЛН
I tried Roblox HOURS and it destroyed me (I'm addicted)
16:01
The Best Roblox Studio Features (and Why You Should Use Them)
19:31
How To Make CHAT TAGS in ROBLOX STUDIO
5:44
Lennert
Рет қаралды 7 М.
The New Studio UPDATE Is AWESOME!
13:26
RoBuilder
Рет қаралды 45 М.
Are YOU making these Game Dev Mistakes?
24:20
GnomeCode
Рет қаралды 236 М.
Programming Rarity is Harder Than You Think
12:31
ByteBlox
Рет қаралды 270 М.
I Made a Graphics Engine in Scratch
8:27
Zyger
Рет қаралды 144 М.
Making a Game in Lua with No Experience
5:52
Goodgis
Рет қаралды 313 М.
Roblox Devs, stop misusing :WaitForChild()!
17:13
Crusherfire
Рет қаралды 67 М.
How To EASILY Make Procedural Animations In Roblox
6:46
Остановили аттракцион из-за дочки!
00:42
Victoria Portfolio
Рет қаралды 3,8 МЛН