Remote Functions (Two-Way Communication) - Roblox Advanced Scripting #6

  Рет қаралды 31,358

BrawlDev

BrawlDev

Күн бұрын

Пікірлер: 137
@Likeable_Emmec
@Likeable_Emmec Жыл бұрын
Wow. Honestly impressed with how you explained things here! I'm a little rusty on the RemoteFunction since it doesn't have too much scenarios I use in my games, so having a tutorial as in-depth as this is really helpful. Keep up the great work!
@BrawlDevRBLX
@BrawlDevRBLX Жыл бұрын
I'm glad to hear that! It seems like people find it less interesting for in-depth explanations and want to get straight to the answer of implementation. I've been debating about this, but I think what I'm doing is really helpful for a bunch of people who want to understand these concepts in greater detail and I don't have to give that up just to be more appealing to the general audience. I hope you continue to find my videos helpful, even if they are explained pretty long! 😅
@savipott
@savipott 2 ай бұрын
@@BrawlDevRBLX i personally don't think I would be able to understand this without the long explanation... If anything, the length just gives you more time to really get in-depth with the matter at hand, and since it's quite a complicated subject, the more material the better!!! P.S i'm really happy with the progress I've been making in scripting due to you!! cheers on 21k!!!!
@momomon7662
@momomon7662 5 ай бұрын
That challenge at the end was so hard, I spent well over an hour (I think almost two hours) writing it, testing it, fixing the bugs, testing it again, searching up errors that popped up in the output and then fixing it again, it was SO SO SO much fun, even though I did get frustrated just staring at the code trying to think of anything else that I could possibly do that could fix the code, but the satisfaction at the end after debugging everything myself and staring at the screen trying to think of anything I could do to change the code so that it works, I cannot explain how happy I am with myself after that challenge. I owe you so much.
@coolkid7377
@coolkid7377 4 ай бұрын
thats the attitude you need to be a good coder
@Bijimix
@Bijimix 2 ай бұрын
same bro
@the4thmuffin874
@the4thmuffin874 7 ай бұрын
ive never seen a more in-depth scripting guide than yours. I've watched the beginner scripting tutorial and planning to watch all of the advanced scripting. You are the best youtuber for learning how to code
@ABOT_OW
@ABOT_OW Жыл бұрын
Thank you for helping me understand this man! Underrated as hell.
@dont-know_00
@dont-know_00 8 ай бұрын
never been so confused in my life i think 😭😭
@Hexplaysroblox
@Hexplaysroblox 5 ай бұрын
same
@patpace
@patpace 5 ай бұрын
if yes, what about returns?
@owlzam612
@owlzam612 5 ай бұрын
@@patpace idek what return end does 😭
@patpace
@patpace 5 ай бұрын
@@owlzam612 return delivers and stores a value back to the function. Simple as it gets.
@Project_Ares01
@Project_Ares01 4 ай бұрын
@@owlzam612 It basically gives the value contained in the variable. in the video, the variable PurchaseSuccessful = true which means that the variable PurchaseSuccessful contains the boolean value - true when it's called to return, the variable contains the value which is true so when they checked if the PurchaseSuccessful == true then it's indeed - true
@crammplays3532
@crammplays3532 Жыл бұрын
Bro this tutorial is perfect for someone like me 😅 The way you explain is perfect and you even include some complicated ones like the syntax. You're the best keep it up! I hope you get popular someday ❤
@BrawlDevRBLX
@BrawlDevRBLX Жыл бұрын
That's great to hear my teaching style is helping you! Hope you stick around when I do get popular! :)
@aaaaaaaaaaaawda
@aaaaaaaaaaaawda 20 күн бұрын
dude im SOOOO happy with your tutorials man ur the goat, i was honestly shocked that i was able to do the challenge without watching the vid man thank you for making great content, much love!
@Averist
@Averist 3 ай бұрын
I have been learning developing for a year now. So i already have some knowledge on this. You make everything seem easier for me thank you. Ans and also guys developing is not something you learn in a week or a month it takes a lot of time. Even big developers dont know everything on developing. Just KEEP LEARNING AND PRACTICING. I hope you find this comment useful.❤
@pr0doxz410
@pr0doxz410 Жыл бұрын
You know it’s a good day when BrawlDev uploades!!
@oliwier1578
@oliwier1578 17 күн бұрын
loved the challenge i did it in around 20/30mins also its so nice to see that im able to script stuff without problem even tho i started learning around 2 weeks ago so thank you because this is the only tutorial that i can understand easily and fast
@ItzBlixYT
@ItzBlixYT Ай бұрын
Thanks so much for a series like this BrawlDev! The challenges are a fun part to do
@kosmosaurus
@kosmosaurus 4 ай бұрын
I've been reading some scripting books and when I got to the Remote Functions chapter, I never understood it. Now I can make a whole shop without looking at anything for help! The challenge was really fun, not too hard, and I didn't even have any bugs! Thanks so much (again)!
@TackJum
@TackJum Жыл бұрын
Honestly I wish you could just get picked up by the algorithm already cause these are actually useful
@BrawlDevRBLX
@BrawlDevRBLX Жыл бұрын
Gotta play the long game for my channel! I'm gonna hope one day a random video explodes and then the new viewers sees my backlog of content lol. Thank you for sticking around and hope you continue to while I'm still small :)
@agoobaka
@agoobaka 8 ай бұрын
You seriously need some more attention. Like, the way you teach (like the intro explanation) is very easy to understand. The challenges you also do are very helpful as to remember the other things and such. When I'm done with this series i can give you more feedback. Anyways, thanks for making good tutorials.
@joncepearce7293
@joncepearce7293 4 ай бұрын
This tutorial was much more helpful and direct than any other videos I've seen without being confusing. This deserves more views
@Project_Ares01
@Project_Ares01 4 ай бұрын
That was a really fun challenge. (probably because I succeeded) Although I didn't approach it the same way that you did because I lack experience on using variables, parameters, and tables (I also created individual remote events for each call too). I ended up repeating myself many times and it felt tedious and boring. but in the end, I succeeded, and I was happy for myself. The excitement from succeeding on the challenge didn't last long as I watched you code the same thing but taking 1/5 of the time it took me to make while not even using tables😅. But then I remember that I shouldn't be comparing myself to someone who has a lot more experience and knowledge, instead, take the comparison as a lesson to learn about my lack of knowledge and skills, therefore allowing me to grow even more. Your tutorials actually teach us how to program not just what to program. Anyway again, thank you for all the tutorials, it's awesome!
@TheAndrey1
@TheAndrey1 4 ай бұрын
Hey! It took me 3 days to understand remote functions and remote events at least, it was pretty hard to get everything you need about these topics, and it took me over 1.5 hours to make the last challenge shop system!, Thank you very much for making these videos, i learned a lot!!!
@YupLeditz
@YupLeditz 3 ай бұрын
can u plz explain
@liko_was_here
@liko_was_here 3 ай бұрын
@@YupLeditz practice makes perfect
@ItsFootball-CR7
@ItsFootball-CR7 2 ай бұрын
This is very big, but it is very simple
@ruify6799
@ruify6799 Жыл бұрын
Wonderful video! loved the challenge keep it up!
@skil1ed_2011
@skil1ed_2011 4 ай бұрын
A precious tutorial. Keep going I'm loving it. I'm understanding way more than I ever expected to :D
@Boomboomboy-j6x
@Boomboomboy-j6x 3 ай бұрын
Thanks man, I was wanting to make a Roblox game and I thought I was a downer at scripting because I couldn’t find anyone who did a beginners tutorial so thanks man 👍🏼
@CodeByteCrafter
@CodeByteCrafter 5 ай бұрын
at first i was rlly confused with both events and functions, After watching for 2-3 times and practising different things i can confirm that remote events and functions are not hard or easy and rlly useful. once again tysm for these turtorials!!!❤
@baconheadhair6938
@baconheadhair6938 6 ай бұрын
0:51 ive just used remote events to do that, you can just fire server then fire the client in the fire server functions and it works the same
@Naz-tj2hv
@Naz-tj2hv 28 күн бұрын
The challenge was good and I was able to do it in around 25 mins, but I wanted to try and challenge myself further and made two different for loops and made a table in both the local and server script, and this made it so I didnt have to write all 3 different things for each button in the server and local script. very good challenge thanks for the video :D
@twinz4364
@twinz4364 27 күн бұрын
quick question you say you were able to do this challenge in 25 mins? May I ask if you watch these videos back to back in succession or devote particular periods of time to master the contents of a singular video on these topics?
@Naz-tj2hv
@Naz-tj2hv 24 күн бұрын
@twinz4364 I watched the vid once, went back to see the syntax of how to create a remotefunction because I got stuck, and then was able to finish the program. I watch each video very closely and if i think I got it i move on to the next vid in the playlist but if I do need relearn a topic i just keep replaying that section Im stuck on until I understand it
@FireBloxPlaysRBLX
@FireBloxPlaysRBLX 15 күн бұрын
From the Client to the server to the script to the stats🔥
@realsuperjuice
@realsuperjuice Жыл бұрын
you are so good at explaining!
@Proxypp
@Proxypp 7 ай бұрын
you are the best at explaining!
@Vent-rn6ze
@Vent-rn6ze 4 ай бұрын
hi im watching this as a beginner trying to learn how to script for freelancing, i love your videos keep doing them PLEASE their extremely helpful and have a touch that no other tutorials have. i think i would 1000% watch you script with you just talking about anything really, as those videos although seem boring would really be entertaining imo
@Proxypp
@Proxypp 7 ай бұрын
why do you only have 5k subscribers, you deserve more ):
@lolaswift111
@lolaswift111 9 ай бұрын
With realworld examples. Simply awesome. many many thanks!
@baconheadhair6938
@baconheadhair6938 6 ай бұрын
🙏 😊 thanks
@secondzephyr
@secondzephyr 6 ай бұрын
thank you SO much for making coding videos. I think that these are honestly the only ones that work for me
@Azalee3
@Azalee3 11 ай бұрын
Hi i have a question at 24:19 i tried to make a for loop buy im a starter so i dont know where to put the arguments exemple of what i made Local button = { Button1, Button2, Button3 } For _, k in paires(button) do k.MouseButtonclick1:connect(function( Local purchasesuccesseful = remotefunction.InvokeServer(and how i put the argement for each button ?) End) End And i want to know what to i put the argement of each buttons like "sword" for item and price argument i need the awnser cuz im doing the same in my game and need these 2 argument PLS HELPPPP
@jagdishramesh6636
@jagdishramesh6636 9 ай бұрын
Honestly dude just put your question through chatgpt
@jagdishramesh6636
@jagdishramesh6636 9 ай бұрын
O nvm im late lol
@agoobaka
@agoobaka 8 ай бұрын
Local b = { -- b short for button ["B1"] = (button location), ["B2"] = (button location), ["B3"] = (button location) } For _, k in pairs(button) do k.MouseButtonclick1:connect(function(b ["B1",], b ["B2"], ["B3], (put in prices here IN ORDER) Local purchasesuccesseful = remotefunction:InvokeServer(b End End (tell me if it works but im just theorizing) for leader stats: remote.OnServerInvoke = function(plr, b1, b2, b3, (prices))
@coolkid7377
@coolkid7377 7 ай бұрын
@@agoobaka oh you used dictionaries. I tried using arrays and then use an in pair loops. Everything looked good so far until it was referencing the mouseclick. it didn't work for me :(
@agoobaka
@agoobaka 6 ай бұрын
@@coolkid7377 srry im also new just tried helping
@ZyanFernando
@ZyanFernando 11 ай бұрын
Bro not only explains but also gives us challenges for real time uses and has only 2k subs while cringe tiktokers are in millions. Damn..
@Gladiator-GamePartsPlays
@Gladiator-GamePartsPlays 4 ай бұрын
Facts
@neogamer123
@neogamer123 4 ай бұрын
Awesome video especially the last part of shopping for tools.
@Light-u3h
@Light-u3h 22 күн бұрын
Lowkey spend an hour doin this but i did some extra things to the shop such as showing the entire shop when i press the shop button and making it close when pressed again soo probably worth it i guess
@Golden_Shamrock
@Golden_Shamrock 2 ай бұрын
You're like a hidden gem in the world of teaching.
@Rad1ation
@Rad1ation 2 күн бұрын
15:53 What if you need Information from the host? (The User) Thats basically the only reason I could see that happen
@MultiplyMaster
@MultiplyMaster 3 ай бұрын
Really good tutorial :D btw how did you make the icons in explorer look like that?
@miso9292
@miso9292 5 ай бұрын
challenge at the end had my script looking so messy, unfortunately had to look at the video to follow through with it, just a few errors on my script which totally messed it up, but I'm taking it as a learning moment! scripting involves so much trial and error i have to get used to it
@onlyAJ2
@onlyAJ2 11 ай бұрын
your videos helped me alot with scripting!
@prixxyGMD
@prixxyGMD 8 күн бұрын
This is so usefull bro! Thank you!!
@F1R3CPU
@F1R3CPU 10 ай бұрын
About the challenge what I did is put the tools in replicated storage and I didn't any arguments on InvokeServer (I scripted each function separately) and the Clone() I did it on the local script inside the shop GUI and it worked. I don't know if I did correct or it is better the method shown in the video
@ANTIPHXBIA-Off
@ANTIPHXBIA-Off 7 ай бұрын
thats actually a kinda complicated one for me. idk why tho cuz i am good at remote events but not at remote functions
@الخلبوصة
@الخلبوصة 7 ай бұрын
same
@ghosthunterroblox2549
@ghosthunterroblox2549 4 ай бұрын
I am going to do this challenge later because im making a game with everything im learning with you i think at the result of the game it is going to be great
@crystawl
@crystawl 11 күн бұрын
while doing the challenge I thought I had finished it, but after watching your version I noticed my script would only show the tool for those who had the tool, I fixed it based on yours, so I guess I lost my first challenge 😭
@zenkai_ii
@zenkai_ii 8 ай бұрын
Bro Im learning a lot w man
@queijoqualhofanaf
@queijoqualhofanaf 3 ай бұрын
For the challenge, you can simply make the entire mousebuttonclick section a function and write local player = game.Players.LocalPlayer soo it knows which player's backpack the tool should be put
@ChampionsDontWearShirts-hv6cr
@ChampionsDontWearShirts-hv6cr 7 ай бұрын
it took me 3 days to understand this. im so slow lol
@Grrzk
@Grrzk Ай бұрын
From since i reached remote events things just get confusing
@trollgangz9322
@trollgangz9322 2 ай бұрын
wouldnt a good use case for server-client-server functions be to calculate stuff, like isnt it better to give the work to 20 different clients instead of doing the work for 20 clients?
@wateronpaper335
@wateronpaper335 Ай бұрын
i feel my brain imploding
@ThatGuyNamedBender
@ThatGuyNamedBender Ай бұрын
Pre-video comment before I watch as I am curious if it will make what I did easier lol So I handled security for these interations between server and client using events and a profilestore Within the profile store I have a key for each player going security -> actionHash In my server script I handle an interaction event with a proximity prompt that then creates a sha256 encrypted key based on several factors which I can't reveal but then that hash gets stored to the player's security.actionHash data then I fire a client event to handle gui and animations but I send that hash to the client, then when that gui/animation finishes it fires back to the server with action hash then the server deems whether or not it matches with whats on the player's data store and if it does then it erases that old action hash from the data store and considers the message from the client to be a valid action completion. Now I'm gonna watch this to see if it remote functions are better than my convoluted action encryption
@Fahriyh
@Fahriyh 2 ай бұрын
15:12 can someone help me it says leaderstat os not a valid member of played
@10ficile2retrouver
@10ficile2retrouver 26 күн бұрын
Why Did u not directly Connect the mousebutton event to the remote function in ur local script?
@WhoLetsBludCook
@WhoLetsBludCook Ай бұрын
Great tutorial !!
@UsTube.
@UsTube. 6 ай бұрын
I failed to do the challenge it’s to hard😅
@2kmadzz185
@2kmadzz185 Жыл бұрын
amazing video, you should make one about Module Script
@Real_Feeki
@Real_Feeki 2 ай бұрын
Time for the challenge starting at 19:55 let´s see how much time till i finish this
@Real_Feeki
@Real_Feeki 2 ай бұрын
If i were to copy all the other scripts it would be a huge commentary so hell nah
@jlboss_ps4751
@jlboss_ps4751 4 ай бұрын
I DID THE CHALLENGE FINALLY!!
@kura.x
@kura.x 7 ай бұрын
tysm but where did you get the buy sound at the beginning plsss
@UnusualYT1189
@UnusualYT1189 5 ай бұрын
- - 20:42
@JohnPaul-v2f
@JohnPaul-v2f 3 ай бұрын
you really know its gonna be a hard one when it is 30+ mins
@Drownsauce
@Drownsauce 5 ай бұрын
this man underrated fr
@brokeneyealert3984
@brokeneyealert3984 7 ай бұрын
tnx a lot and I learned a lot form your videos series
@arwindelossantos3890
@arwindelossantos3890 5 ай бұрын
What do I need to to if it says that "I'm not authorized to access asset"
@binchicken7935
@binchicken7935 2 ай бұрын
I implemented the new leaderstats scripts into the leaderstats script I've been using for all your videos and nothing happened when I clicked "Purchase button". I didn't get an error or anything. I disabled my leaderstats script and copied the necessary lines for my remote function button into a new leaderstats script and it worked. Could you or someone explain why this happened and how my other remote event script could have effected it?
@Apple_Tie
@Apple_Tie 3 ай бұрын
I'm always able to do most of the challenges, but not in the most effective way as does anyone experience the same thing?
@ScpSite19Roleplay
@ScpSite19Roleplay 12 күн бұрын
The only thing I have hard for in these codes is how to begin and how to think. What do I need to write to make this work and how can I do this for the best result.
@Sirius-p4m
@Sirius-p4m Ай бұрын
i dont know how to make something that give me tool but i made gates that you buy it its open
@JohnPaul-v2f
@JohnPaul-v2f 3 ай бұрын
i think im slowly gettin it
@ghosthunterroblox2549
@ghosthunterroblox2549 4 ай бұрын
Can you explain me how to make a event that if the player keeps standing in a part then something happens idk, because i seached and didnt found i just founded touchended. Pls do a video on this or just explain it pls
@Safashifin
@Safashifin 8 ай бұрын
W demonstrations ty
@bobthebuilder-do1rt
@bobthebuilder-do1rt 2 ай бұрын
I finished the begginer scripting tutorial today.
@likeememecompilation6879
@likeememecompilation6879 9 ай бұрын
When I become successful I’m coming back to pay you I promise ❤
@BrawlDevRBLX
@BrawlDevRBLX 9 ай бұрын
I will be waiting when you become a top tier dev! :)
@AniCut1174
@AniCut1174 3 ай бұрын
can you do it with scripts and models?
@Stone0001
@Stone0001 8 ай бұрын
I managed to do the challenge I did re use a little code though. Is that allowed?
@BrawlDevRBLX
@BrawlDevRBLX 8 ай бұрын
Whatever works for you bro!
@Dominodadoggy
@Dominodadoggy 3 ай бұрын
YOU ARE THE BEST ROBLOX SCRIPTING TEACHER ALIVE!!! YOU START FROM THE VERY BASICS AND YOUR REALLY MAKING MY DREAMS COME TRUE!!! IM WORKING ON A GAME WITH OTHER PPL CALLED SLASH BATTLES. if i ever do become a good scripter, i will never forget the help you gave me
@الخلبوصة
@الخلبوصة 7 ай бұрын
I WAS ABLE TO DO THE CHALLENGE
@GimboFlop
@GimboFlop Жыл бұрын
How do you make it so you can only buy one weapon
@Azalee3
@Azalee3 11 ай бұрын
What do u mean ? If u said how to just have no price just take them of
@GimboFlop
@GimboFlop 11 ай бұрын
@@Azalee3 you can buy more then one of a specific item
@valerix7613
@valerix7613 10 ай бұрын
@@GimboFlop I'm a new scripter here so apologies if I made a mistake. I think you can use "debounce" (basically just a variable but I saw many ppl use that name) and set the value of it equal to false. Then add an if statement inside of the function connected to the MouseButton1Click event. This is how I do it: local remote = game.ReplicatedStorage.RemoteFunction local debounce1 = false script.Parent.Pizza.MouseButton1Down:Connect(function() if not debounce1 then debounce1 = true local success = remote:InvokeServer("pizza") if success == "Pizza Purchased" then script.Parent.Pizza.BackgroundColor3 = Color3.new(0.137255, 1, 0.207843) script.Parent.Pizza.Text = "Purchase Succeed!" else script.Parent.Pizza.BackgroundColor3 = Color3.new(1, 0, 0.0156863) script.Parent.Pizza.Text = "Purchase Failed!" end end end) Btw the code is different from the video in some places but for me it works. Let me know how it works and hope this could help!
@Lucas-xn5bn
@Lucas-xn5bn 8 ай бұрын
@@GimboFlop You can just set a if condition that checks if a tool already exists in the backpack and then once it does, disable the buy button and put like "Bought" or "Failed" in the text.
@GimboFlop
@GimboFlop 8 ай бұрын
@@Lucas-xn5bn oh I fixed a while ago but thanks
@z3rok41
@z3rok41 4 ай бұрын
it doesnt work for me every time i do it, with every tutorial it never works 🙏
@YupLeditz
@YupLeditz 3 ай бұрын
well its yo fault
@TyKo-h8w
@TyKo-h8w 4 ай бұрын
We need a PROGRAM TOOL!
@Kyo-d
@Kyo-d 6 ай бұрын
Tried to do it with for i,v and it worked ty! local Rs = game.ReplicatedStorage local Buy = Rs.Buy local Gui = script.Parent local Light = Gui.Light local Med = Gui.Med local Heavy = Gui.Heavy local table = {Light, Med, Heavy} for i,v in pairs(table) do v.MouseButton1Click:Connect(function() if v == Light then local Light = Buy:InvokeServer(Light, 25) if Light then print("yay") else print("Nope") end elseif v == Med then local Med = Buy:InvokeServer(Med, 50) if Med then print("yay") else print("nope") end elseif v == Heavy then local Heavy = Buy:InvokeServer(Heavy, 120) if Heavy then print("yay") else print("nah") end end end) end
@Appolo-dw7hi
@Appolo-dw7hi 7 ай бұрын
Thanks i learnt now
@muhammadfaizan5856
@muhammadfaizan5856 4 ай бұрын
hmm my brain died
@JohnPaul-v2f
@JohnPaul-v2f 3 ай бұрын
amazing
@GrindGamerX
@GrindGamerX Жыл бұрын
Nice
@egggrenade2746
@egggrenade2746 Ай бұрын
Brawldev I'm going to get murdered by this challenge. I boutta die Edit: Brawldev I did it in 2 hours. Your shop looks like doodoo compared to mine (even tho you did it like 10 minutes ;-;). Anyways I had headaches until the morning but I still did it. I made the shop a toggle-able popup when you pressed a "Shop" button in the left corner. Also I used a table with prices n stuff cuz I still didn't fully understand tables. Now I understand tables too. I didn't make a prompt and instead just made the button itself say the purchase was successfull.
@nathanbuckner2691
@nathanbuckner2691 Ай бұрын
Nice Dedication to scripting I like it
@StolenTextures
@StolenTextures 6 ай бұрын
I love watching videos like this and seeing the view count go down with each one as people are all giving up
@mohamedemad7519
@mohamedemad7519 4 ай бұрын
I dont recommend ppl to use remote functions its so bad to usr
@wilsonybiernasiii7287
@wilsonybiernasiii7287 3 ай бұрын
Sakit na ulo ko
@skyvis8653
@skyvis8653 2 ай бұрын
this is how i looped through them local Tablee = { SpeedBuyButton, JumpBuyButton, SpeedJumpBuyButton } for i , v in pairs(Tablee) do v.MouseButton1Click:Connect(function() local Purchasesucs = remoteFunction:InvokeServer(game.ReplicatedStorage.Speed,v.Value.Value) if Purchasesucs then local oldtext = v.Text v.Text = "Purchase SUCCESSFUL!" v.BackgroundColor3 = Color3.new(0,255,0) task.wait(1) v.Text = oldtext v.BackgroundColor3 = Color3.new(0.333333, 0, 0.498039) else local oldtext = v.Text v.Text = "Purchase FAILED!" v.BackgroundColor3 = Color3.new(255,0,0) task.wait(1) v.Text = oldtext v.BackgroundColor3 = Color3.new(0.333333, 0, 0.498039) end end) end
@CACACACACACACACCAC
@CACACACACACACACCAC 6 ай бұрын
local screengui = script.Parent local scrollingframe = screengui.ScrollingFrame local function buyItem(itemName, itemPrice) local success = game.ReplicatedStorage.RemoteFunction:InvokeServer(itemPrice, itemName) if success then print("purchase successful for", itemName) else print("purchase failed for", itemName) end end local buySword = scrollingframe.BuySword local buyKnife = scrollingframe.BuyKnife local buyGun = scrollingframe.BuyGun buySword.MouseButton1Down:Connect(function() buyItem("Sword", 5) end) buyKnife.MouseButton1Down:Connect(function() buyItem("Knife", 10) end) buyGun.MouseButton1Down:Connect(function() buyItem("Gun", 15) end)
@amara7734
@amara7734 7 ай бұрын
For some reason I decided to spend a good 4 hours on the gui for the challenge lol, anyway here was my code local gui = script.Parent local shopButton = gui.ShopButton local Players = game:GetService("Players") local player = Players.LocalPlayer local swordTool = game.ReplicatedStorage:WaitForChild("SwordTool") local gunTool = game.ReplicatedStorage:WaitForChild("GunTool") local bowTool = game.ReplicatedStorage:WaitForChild("BowTool") local shieldTool = game.ReplicatedStorage:WaitForChild("ShieldTool") local shopFrame = game.StarterGui:WaitForChild("ShopFrame") shopButton.MouseButton1Click:Connect(function() shopButton.Active = false shopButton.Visible = false local shopGUI = shopFrame:Clone() shopGUI.Parent = gui local prompt = shopGUI.Prompt local buyButtonSword = shopGUI.BuyButtonSword buyButtonSword.MouseButton1Click:Connect(function() local purchaseSuccessful = game.ReplicatedStorage.BuyButtonSword:InvokeServer() if purchaseSuccessful == true then swordTool.Parent = player.Backpack prompt.Text = "PURCHASE SUCCESSFUL!" prompt.BackgroundColor3 = Color3.fromRGB(0, 255, 0) else prompt.Text = "PURCHASE FAILED!" prompt.BackgroundColor3 = Color3.fromRGB(255, 0, 0) end end) local buyButtonGun = shopGUI.BuyButtonGun buyButtonGun.MouseButton1Click:Connect(function() local purchaseSuccessful = game.ReplicatedStorage.BuyButtonGun:InvokeServer() if purchaseSuccessful == true then gunTool.Parent = player.Backpack prompt.Text = "PURCHASE SUCCESSFUL!" prompt.BackgroundColor3 = Color3.fromRGB(0, 255, 0) else prompt.Text = "PURCHASE FAILED!" prompt.BackgroundColor3 = Color3.fromRGB(255, 0, 0) end end) local buyButtonBow = shopGUI.BuyButtonBow buyButtonBow.MouseButton1Click:Connect(function() local purchaseSuccessful = game.ReplicatedStorage.BuyButtonBow:InvokeServer() if purchaseSuccessful == true then bowTool.Parent = player.Backpack prompt.Text = "PURCHASE SUCCESSFUL!" prompt.BackgroundColor3 = Color3.fromRGB(0, 255, 0) else prompt.Text = "PURCHASE FAILED!" prompt.BackgroundColor3 = Color3.fromRGB(255, 0, 0) end end) local buyButtonShield = shopGUI.BuyButtonShield buyButtonShield.MouseButton1Click:Connect(function() local purchaseSuccessful = game.ReplicatedStorage.BuyButtonShield:InvokeServer() if purchaseSuccessful == true then shieldTool.Parent = player.Backpack prompt.Text = "PURCHASE SUCCESSFUL!" prompt.BackgroundColor3 = Color3.fromRGB(0, 255, 0) else prompt.Text = "PURCHASE FAILED!" prompt.BackgroundColor3 = Color3.fromRGB(255, 0, 0) end end) local shopExitButton = shopGUI:WaitForChild("ShopExitButton") shopExitButton.MouseButton1Click:Connect(function() game:GetService("Debris"):AddItem(shopGUI, 0) shopButton.Active = true shopButton.Visible = true end) end) It still looks really mundane but i see a lesson on gui in the future so we get there when we get there. I was even thinking of creating the shop as a new instance everytime but the idea sounded worse the more i thought about it. You're an excellent teacher and i hope your channel blows up.
@Light-u3h
@Light-u3h 22 күн бұрын
i heard you dont need to use waitforchild when trying to find something in replicated storage idk
@Soliriox
@Soliriox 7 ай бұрын
I did a version where it works with the replicated storage but I look the one u did. Great video local buybuttonremote = game.ReplicatedStorage.RemoteFunction local Gui = script.Parent local Prompt = Gui.TextLabel local Frame = Gui.Frame local BuyPillow = Frame.Pillow local BuySword = Frame.Sword local BuyGun = Frame.Gun local players = game:GetService("Players") BuyPillow.TextButton.MouseButton1Click:Connect(function() local purchaseSuccessful = buybuttonremote:InvokeServer() if purchaseSuccessful then local plr = players.LocalPlayer local Pillow = game.ReplicatedStorage.Pillow:Clone() Pillow.Parent = plr.Backpack else Prompt.visible = true task.wait(3) Prompt.Visible = false task.wait() end end) BuySword.TextButton.MouseButton1Click:Connect(function() local purchaseSuccessful = buybuttonremote:InvokeServer() if purchaseSuccessful then local plr = players.LocalPlayer local Sword = game.ReplicatedStorage.Sword:Clone() Sword.Parent = plr.Backpack else Prompt.visible = true task.wait(3) Prompt.Visible = false task.wait() end end) BuyGun.TextButton.MouseButton1Click:Connect(function() local purchaseSuccessful = buybuttonremote:InvokeServer() if purchaseSuccessful then local plr = players.LocalPlayer local Gun = game.ReplicatedStorage.Gun:Clone() Gun.Parent = plr.Backpack else Prompt.Visible = true task.wait(3) Prompt.Visible = false task.wait() end end)
Vector3 - Roblox Advanced Scripting #7
24:56
BrawlDev
Рет қаралды 17 М.
Мен атып көрмегенмін ! | Qalam | 5 серия
25:41
Cheerleader Transformation That Left Everyone Speechless! #shorts
00:27
Fabiosa Best Lifehacks
Рет қаралды 16 МЛН
My scorpion was taken away from me 😢
00:55
TyphoonFast 5
Рет қаралды 2,7 МЛН
HTML and CSS Tutorial (2025)
25:50
LearnWebCode
Рет қаралды 1,5 М.
I Made a Fake Warning to Scare Roblox Players
16:31
ByteBlox
Рет қаралды 2 МЛН
Classic Roblox Games: How Are They Doing?
17:09
Chappy
Рет қаралды 476 М.
Why Roblox Studio is Confusing For Beginners
15:22
ByteBlox
Рет қаралды 143 М.
Roblox Devs, stop misusing :WaitForChild()!
17:13
Crusherfire
Рет қаралды 77 М.
How Unoptimized Can a Roblox Game Get?
16:49
ByteBlox
Рет қаралды 322 М.
Can 14 Random ROBLOX Developers Make a Game in 7 DAYS?
15:56
BrawlDev
Рет қаралды 145 М.
Coroutines - Roblox Advanced Scripting #8
33:39
BrawlDev
Рет қаралды 29 М.