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

  Рет қаралды 25,849

BrawlDev

BrawlDev

Күн бұрын

Пікірлер: 127
@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 Ай бұрын
@@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 4 ай бұрын
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 2 ай бұрын
thats the attitude you need to be a good coder
@Bijimix
@Bijimix Ай бұрын
same bro
@ABOT_OW
@ABOT_OW Жыл бұрын
Thank you for helping me understand this man! Underrated as hell.
@dont-know_00
@dont-know_00 7 ай бұрын
never been so confused in my life i think 😭😭
@Hexplaysroblox
@Hexplaysroblox 4 ай бұрын
same
@patpace
@patpace 4 ай бұрын
if yes, what about returns?
@owlzam612
@owlzam612 4 ай бұрын
@@patpace idek what return end does 😭
@patpace
@patpace 4 ай бұрын
@@owlzam612 return delivers and stores a value back to the function. Simple as it gets.
@Project_Ares01
@Project_Ares01 3 ай бұрын
@@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
@the4thmuffin874
@the4thmuffin874 6 ай бұрын
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
@pr0doxz410
@pr0doxz410 Жыл бұрын
You know it’s a good day when BrawlDev uploades!!
@Averist
@Averist Ай бұрын
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.❤
@ItzBlixYT
@ItzBlixYT 17 күн бұрын
Thanks so much for a series like this BrawlDev! The challenges are a fun part to do
@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 :)
@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! :)
@lolaswift111
@lolaswift111 8 ай бұрын
With realworld examples. Simply awesome. many many thanks!
@baconheadhair6938
@baconheadhair6938 5 ай бұрын
🙏 😊 thanks
@kosmosaurus
@kosmosaurus 3 ай бұрын
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)!
@ZyanFernando
@ZyanFernando 10 ай бұрын
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 3 ай бұрын
Facts
@joncepearce7293
@joncepearce7293 3 ай бұрын
This tutorial was much more helpful and direct than any other videos I've seen without being confusing. This deserves more views
@Boomboomboy-j6x
@Boomboomboy-j6x 2 ай бұрын
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 👍🏼
@Project_Ares01
@Project_Ares01 3 ай бұрын
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!
@CodeByteCrafter
@CodeByteCrafter 4 ай бұрын
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!!!❤
@agoobaka
@agoobaka 7 ай бұрын
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.
@TheAndrey1
@TheAndrey1 3 ай бұрын
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 2 ай бұрын
can u plz explain
@liko_was_here
@liko_was_here 2 ай бұрын
@@YupLeditz practice makes perfect
@ItsFootball-CR7
@ItsFootball-CR7 Ай бұрын
This is very big, but it is very simple
@saifumor
@saifumor 3 ай бұрын
A precious tutorial. Keep going I'm loving it. I'm understanding way more than I ever expected to :D
@Proxypp
@Proxypp 6 ай бұрын
you are the best at explaining!
@Golden_Shamrock
@Golden_Shamrock Ай бұрын
You're like a hidden gem in the world of teaching.
@ruify6799
@ruify6799 11 ай бұрын
Wonderful video! loved the challenge keep it up!
@neogamer123
@neogamer123 3 ай бұрын
Awesome video especially the last part of shopping for tools.
@secondzephyr
@secondzephyr 4 ай бұрын
thank you SO much for making coding videos. I think that these are honestly the only ones that work for me
@Proxypp
@Proxypp 6 ай бұрын
why do you only have 5k subscribers, you deserve more ):
@Vent-rn6ze
@Vent-rn6ze 3 ай бұрын
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
@realsuperjuice
@realsuperjuice Жыл бұрын
you are so good at explaining!
@baconheadhair6938
@baconheadhair6938 5 ай бұрын
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
@miso9292
@miso9292 4 ай бұрын
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 10 ай бұрын
your videos helped me alot with scripting!
@MultiplyMaster
@MultiplyMaster 2 ай бұрын
Really good tutorial :D btw how did you make the icons in explorer look like that?
@F1R3CPU
@F1R3CPU 8 ай бұрын
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
@queijoqualhofanaf
@queijoqualhofanaf 2 ай бұрын
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
@likeememecompilation6879
@likeememecompilation6879 8 ай бұрын
When I become successful I’m coming back to pay you I promise ❤
@BrawlDevRBLX
@BrawlDevRBLX 8 ай бұрын
I will be waiting when you become a top tier dev! :)
@ANTIPHXBIA-Off
@ANTIPHXBIA-Off 6 ай бұрын
thats actually a kinda complicated one for me. idk why tho cuz i am good at remote events but not at remote functions
@صاحب-العقل-والمنطق
@صاحب-العقل-والمنطق 5 ай бұрын
same
@bobthebuilder-do1rt
@bobthebuilder-do1rt Ай бұрын
I finished the begginer scripting tutorial today.
@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
@ChampionsDontWearShirts-hv6cr
@ChampionsDontWearShirts-hv6cr 6 ай бұрын
it took me 3 days to understand this. im so slow lol
@Azalee3
@Azalee3 10 ай бұрын
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 8 ай бұрын
Honestly dude just put your question through chatgpt
@jagdishramesh6636
@jagdishramesh6636 8 ай бұрын
O nvm im late lol
@agoobaka
@agoobaka 7 ай бұрын
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 5 ай бұрын
@@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 5 ай бұрын
@@coolkid7377 srry im also new just tried helping
@ghosthunterroblox2549
@ghosthunterroblox2549 3 ай бұрын
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
@Kyo-d
@Kyo-d 4 ай бұрын
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
@jlboss_ps4751
@jlboss_ps4751 3 ай бұрын
I DID THE CHALLENGE FINALLY!!
@Drownsauce
@Drownsauce 3 ай бұрын
this man underrated fr
@2kmadzz185
@2kmadzz185 Жыл бұрын
amazing video, you should make one about Module Script
@JohnPaul-v2f
@JohnPaul-v2f 2 ай бұрын
you really know its gonna be a hard one when it is 30+ mins
@Real_Feeki
@Real_Feeki Ай бұрын
Time for the challenge starting at 19:55 let´s see how much time till i finish this
@Real_Feeki
@Real_Feeki Ай бұрын
If i were to copy all the other scripts it would be a huge commentary so hell nah
@Dominodadoggy
@Dominodadoggy 2 ай бұрын
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
@Quirkedit
@Quirkedit 6 ай бұрын
Bro Im learning a lot w man
@trollgangz9322
@trollgangz9322 Ай бұрын
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?
@WhoLetsBludCook
@WhoLetsBludCook 6 күн бұрын
Great tutorial !!
@brokeneyealert3984
@brokeneyealert3984 6 ай бұрын
tnx a lot and I learned a lot form your videos series
@Grrzk
@Grrzk 14 күн бұрын
From since i reached remote events things just get confusing
@wateronpaper335
@wateronpaper335 20 күн бұрын
i feel my brain imploding
@JohnPaul-v2f
@JohnPaul-v2f 2 ай бұрын
i think im slowly gettin it
@Apple_Tie
@Apple_Tie Ай бұрын
I'm always able to do most of the challenges, but not in the most effective way as does anyone experience the same thing?
@Safashifin
@Safashifin 7 ай бұрын
W demonstrations ty
@UsTube.
@UsTube. 5 ай бұрын
I failed to do the challenge it’s to hard😅
@binchicken7935
@binchicken7935 Ай бұрын
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?
@ghosthunterroblox2549
@ghosthunterroblox2549 3 ай бұрын
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
@kura.x
@kura.x 6 ай бұрын
tysm but where did you get the buy sound at the beginning plsss
@Sirius-p4m
@Sirius-p4m 16 күн бұрын
i dont know how to make something that give me tool but i made gates that you buy it its open
@YupLeditz
@YupLeditz 2 ай бұрын
took me 4 days to understand 💪 im a slow ahh
@arwindelossantos3890
@arwindelossantos3890 4 ай бұрын
What do I need to to if it says that "I'm not authorized to access asset"
@Appolo-dw7hi
@Appolo-dw7hi 6 ай бұрын
Thanks i learnt now
@صاحب-العقل-والمنطق
@صاحب-العقل-والمنطق 5 ай бұрын
I WAS ABLE TO DO THE CHALLENGE
@Fahriyh
@Fahriyh Ай бұрын
15:12 can someone help me it says leaderstat os not a valid member of played
@AniCut1174
@AniCut1174 Ай бұрын
can you do it with scripts and models?
@JackSaunders-zu6lf
@JackSaunders-zu6lf 3 ай бұрын
Hello, whenever I use the InvokeServer() function I get an error in the output: "Unable to cast value to Object". I've been trying to find a solution for hours and found this video, any idea what it could be? Thanks in advance
@JackSaunders-zu6lf
@JackSaunders-zu6lf 3 ай бұрын
nevermind, its something to do with a modulescript i have.
@TyKo-h8w
@TyKo-h8w 3 ай бұрын
We need a PROGRAM TOOL!
@Stone0001
@Stone0001 7 ай бұрын
I managed to do the challenge I did re use a little code though. Is that allowed?
@BrawlDevRBLX
@BrawlDevRBLX 7 ай бұрын
Whatever works for you bro!
@JohnPaul-v2f
@JohnPaul-v2f 2 ай бұрын
amazing
@muhammadfaizan5856
@muhammadfaizan5856 3 ай бұрын
hmm my brain died
@GrindGamerX
@GrindGamerX Жыл бұрын
Nice
@GimboFlop
@GimboFlop 11 ай бұрын
How do you make it so you can only buy one weapon
@Azalee3
@Azalee3 10 ай бұрын
What do u mean ? If u said how to just have no price just take them of
@GimboFlop
@GimboFlop 10 ай бұрын
@@Azalee3 you can buy more then one of a specific item
@valerix7613
@valerix7613 9 ай бұрын
@@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 7 ай бұрын
@@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 7 ай бұрын
@@Lucas-xn5bn oh I fixed a while ago but thanks
@z3rok41
@z3rok41 3 ай бұрын
it doesnt work for me every time i do it, with every tutorial it never works 🙏
@YupLeditz
@YupLeditz 2 ай бұрын
well its yo fault
@egggrenade2746
@egggrenade2746 25 күн бұрын
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 20 күн бұрын
Nice Dedication to scripting I like it
@StolenTextures
@StolenTextures 4 ай бұрын
I love watching videos like this and seeing the view count go down with each one as people are all giving up
@UnusualYT1189
@UnusualYT1189 4 ай бұрын
- - 20:42
@mohamedemad7519
@mohamedemad7519 2 ай бұрын
I dont recommend ppl to use remote functions its so bad to usr
@wilsonybiernasiii7287
@wilsonybiernasiii7287 Ай бұрын
Sakit na ulo ko
@skyvis8653
@skyvis8653 Ай бұрын
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
@amara7734
@amara7734 6 ай бұрын
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.
@SpinningSpheres
@SpinningSpheres 5 ай бұрын
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)
@Soliriox
@Soliriox 6 ай бұрын
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 (2023)
24:56
BrawlDev
Рет қаралды 14 М.
Bye-bye Raycasting! There's a new kid on the block...
15:13
Crusherfire
Рет қаралды 59 М.
Кто круче, как думаешь?
00:44
МЯТНАЯ ФАНТА
Рет қаралды 6 МЛН
Don’t Choose The Wrong Box 😱
00:41
Topper Guild
Рет қаралды 15 МЛН
How to make your FIRST Roblox Game in 2024 (Make Robux)
29:49
CodeBro29
Рет қаралды 1 МЛН
Can 14 Random ROBLOX Developers Make a Game in 7 DAYS?
15:56
BrawlDev
Рет қаралды 141 М.
This Function Will Save You Hours
11:44
ByteBlox
Рет қаралды 43 М.
i made the same design in programs never made for design
19:38
elliotisacoolguy
Рет қаралды 1,2 МЛН
I spent 1000 DAYS Building My Roblox Game!
12:23
DeHapy
Рет қаралды 194 М.
Кто круче, как думаешь?
00:44
МЯТНАЯ ФАНТА
Рет қаралды 6 МЛН