actually, on his advanced scripting tutorial he made a tutorial on it (im not surprised if you know this as its been about 4 months since you posted it thats what youtube says atleast.)
As soon as I got the notification, I just went straight to it, that’s why I am one of the first ones to watch. Love his scripting tutorials. Nice video. 😀
Wow - the content is coming fast and furious right now - Thank you Alvin for sharing so much. I'm watching each of these multiple times; my primary source of learning at the moment. Much appreciated.
This is the only thing so far that I've struggled with. I think this topic is something that you just got to explore around and find useful services for what you are trying to create.
omg finally i really searched on youtube "alvinblox services" and i was sad because there was no result but you uploaded the video today !?! my chance :D
0:50 WRONG!!! You just defined an object, not a service!! TO THE VEIWERS: The difference between services and nearly all other Roblox objects is that services are singletons. For any aspiring developers who don't know what a singleton object is, stop now and google "singleton pattern". This is a very important concept for any beginning developer to grasp. Furthermore, it is one of those terms that will keep repeatedly popping up as you are learning to code. If you don't learn it early on, it is going to throw you off and make things a bit harder to understand each time it does. Back to my original point, because each service is created as a sngleton, you can only have one at a time. This means that things like parts and players are NOT services because more than one can, and usually do, exist in your game simultaneously. An example of a service is debris. If you you are creating a part that needs to be destroyed soon after (such as a bullet), you add it to the debris service. This is a special object that the game created when it first loaded up. When you close out of your game completely, the service will be destroyed. The point is that whenever the game is running, there is exactly one instance of this service object. Every service exists to handle one specific task (or a set of closely related tasks) and do them well. For example, the job of the debris service is to destroy referenced objects after a predefined length of time. Sure, you could write a script to do this or ifnd some other way to do it, but there are drawbacks. For one thing, if you get rid of a bullet but do not properly destroy it, hours later you could have thousands of "ghost bullets" lagging out your server. Even if you implement them perfectly, you just wasted x amount of time that could have been saved by simply fetching that service and letting it quietly do its job in the background. It is this efficiency, dependability, and ease of use that make services so popular, not just in Roblox, but in most large programming frameworks. Use of services in your code usually isn't required to make your game work, but their proper use will almost always certainly make it run BETTER. This is why you should all get to know the Roblox API and all of the services that it offers you. When you need to do something in your code, first ask yourself, "Does Roblox have a service for that?" If the answer is yes, then by all means, use it! TO ALVINBLOX: There are a LOT of people watching you and taking your every word as law. This is both a privilege AND a responsibility. When you make a tutorial video on a subject that you do not fully understand yourself, you are doing a huge disservice (no pun intended) to them all. Especially when that subject is about a core programming concept like understanding services. Not only will this video potentially set a lot of beginners back in their understanding of the subject, but it will likely result in a lot of games that, at the very least, would have been better otherwise. I truly am sorry for the negative feedback. I wholeheartedly support what you are doing for the Roblox Community. With that said, I feel it as a duty to my less experienced peers to write this. Keep doing what you are doing. Your content is usually great. From now on, just be more cautious. Before making a video, be sure that you are fully aware of the impact that it will have on its viewers and on the Roblox dev community as a whole. Thank you for the content. Keep doing what you're doing. Here is hoping that you always have fun doing it. Sincerely, Nate
Hello Nate, you are probably right, I shouldn't have described it as an object. However, I felt that it would make it easier for a new developer to grasp the idea of what a service was, especially after I had looked around online to see if there were any better explanations and many of them referenced services as being objects since they do contain events, functions etc. I should have picked up on that and mentioned that they work similarly with the idea of having events functions but not exactly being the same due to the reasons you mentioned. However, I don't think my explanation has spread misinformation. This was just a small mistake on my part and I feel it is a minor. I will take your feedback and put it into action if I have the time to make a follow up to this video in the future. Thank you for taking the time to point this out.
Nate thank you for this comment. I've been studying LUA for a few days now and taking notes. I will use this knowledge eventually when I create guns for a game.
The reason why I quit scripting because people with TH-cam videos ,besides you, they teach poorly and makes me feel like a scrub, but because you get into more detail, I decided to script again, and boy am I doing waaaay better than I would imagine.
i love your channel dude , it made lua easier for me , couldnt find those kind of tutorials anywhere 2 years ago so i had to go with c#, now i finally achieved my goal ! and all of that thanks to u !
Can you make a tutorial about how to make player’s last tool drops when getting other tool. And player’s tool drops when he/she leaves. I am having problems. 😀 Nice tutorial by the way!
i don't get it what is the point of services what do they do and what kinds are their and i just don't get the reason why getservice() is important and why u use it
Services is actually taken from OOP speak. If you take a look at Martain Fowlers book it explains them clearly. Or google "OOP Services". It may help existing programmers to understand them better.
Can you make another video about Events? But make it a little bit more informative and explain step by step? I couldn't understand it that much when i watched your video. Keep being cool my friend, i always look up to you in game development!
Nice Video, sure helps me I don't even need to look at my Notes anymore! Also, can you show us how you edit? That would help because I'm starting a channel but I don't know how to edit
local player For i,v in pairs (game.Players:getChildren()) do if i = math.random(1,#players) then v = player break end end I'm pretty sure it's something like that
Ayesp You should put this in a function called selectKiller and create a parameter for what player is selected called “killer”. Set the parameter to the math.random that gets a number between 1 and the number of players when calling the function and then run the loop inside the function to check if the index == killer and then have the function return the value as the killer. I think this would probably be a better way to do this as it modularizes the code so it can be called more often and can even be used to select a specific player as the killer if needed. Of course the function could be modified further to select multiple killers based on the number of connected players in the server if that is something you want. Furthermore, I’m fairly certain your example could cause game bugs since the math.random() function is called every time the loop checks if a players index is considered a killer, which could result in every player getting killer or even no players getting killer. Lastly, your code “if i = math.random(1,#players)” will not work because the game will think you are trying to set the value of i as the condition of the if statement. It’s very common for beginner programmers to get “=“ and “==“ mixed up when setting and checking values of a variable. A handy trick that I do in order to help me remember the differences is that whenever I’m reading or typing the code one “=“ reads in my head as “is” and if theres a second “=“ next to it i read that one as “equal to”. For example: local myVar =(is) 5 if myVar =(is)=(equal to) 5 then print(“myVar is equal to 5”) end I could be wrong about some of this syntax-wise since I’m coming from basic C++/C# and Java, and have been watching these videos to better understand Roblox LUA syntax and how to use its services and such, but these are the things that jump out at me when I see that code. Sorry if I wrote a lot here, I don’t wanna seem rude pointing out all of these things, but I hope there was something you could take away from it all.
after this many tutorials I think that it's time that you make another big game! I think you should cast a vote on your Discord of what type of game you should make a tutorial on I have some recommendation a for some games you should make: Jailbreak game, Epic Minigames game, Arsneal game . But all in VERY Advanced detail for advanced scripters that wanna make something BIG, Thanks for reading!
Auto-Gen Service is local Service, however local Services mean it is can be accessed by anyone even by struggling connection, other Services is Cloud Services they cannot be accessed by a struggling connection
Can I ask a question out of topic please. I have a channel (which I upload videos) and I want to know what software (program) you use to do you drawings and stuff and does it have a mac version? If it doesn't no problem, I have another idea.
Workspace - Store your visible stuff, and characters of the players Lighting - Change lightning Players - All the players themself Repstorage - Visible to both the server and the client, meaning you can access in both local- and serverscript. Serverstorage - only visible to the server, making it impossible to exploit Serverscriptstorage - ^ what ::GetService() Does is it basically gets special services that are not inside of the explorer. some of those services are useful for different types of things, For example Alvin used a marketplace service, you can use this service to purchase catalog,gamepass,website Items In game, there are way more services that are useful for different things. Edit: If you wanted to know what each service Does, then just get the name of the service. then you can either Google it, Or post it asking people what it does on the forums.
Alvin the "PromptGamePassPurchasedFinished" event does not work anymore on roblox. Is either that but am really stuck on how to check if user has bought the gamepass, plz help
When you "bought" the VIP gamepass I thought you actually bought a random gamepass but it turned out roblox allows you to test it if you run it like this lol
Why so many ppl leaving tho I remember the first episode had so much views now I’ve reached this episode it hardly has any views almost 20,000 Ppl give up very fast lmao.that’s sad
bruh he didn't need 40 mins to explain that, basically services are like the workspace, ServerScriptService, or Lighting for example. there are some services that aren't visible like the workspace is. such as the marketplace, and you can make Gamepass prompts with these, if you want that script just skip here: 25:13
I have a question which doesn't have to do anything with this video. I think. How can you make an item spawner, but when the player picks up the item, it won't despawn from his inventory.(it's for a survival game)
Hello, how can I put a gamepass in a part, so when the local player touches the part, a gamepass purchase will pop up. I tried the script below. script.Parent.Touched:Connect(function() game:GetService("MarketplaceService"):PromptGamePassPurchase(game.Players,123) end) This was the error I got. 12:11:03.140 - MarketplaceService:PromptGamePassPurchase() player should be of type Player, but is of type Players 12:11:03.140 - Stack Begin 12:11:03.141 - Script 'Workspace.Part.Script', Line 2 12:11:03.141 - Stack End 12:11:06.466 - ScriptNavigationHandler : No script currently available.
Dang this old but script.Parent.Touched:Connect(function(OtherPart) --- part that touched the part local player = game.Players:GetPlayerFromCharacter(OtherPart.Parent.Parent) if player then game:GetService("MarketplaceService"):PromptGamePassPurchase(player,123) end end) The reason your code didn't work is because you're grabbing the parent of the players. We can grab the player that touched the part. Also I wrote this without testing in studio so if it doesn't work it must be a syntax error.
Make a tutorial on UserInputService and binding keys to events I'm sure people would want that
y e s
Omg yes
actually, on his advanced scripting tutorial he made a tutorial on it (im not surprised if you know this as its been about 4 months since you posted it thats what youtube says atleast.)
yes
@Jack Corbett thx for linking
As soon as I got the notification, I just went straight to it, that’s why I am one of the first ones to watch. Love his scripting tutorials. Nice video. 😀
notfications usually pop up a couple minutes later
YOU'RE A SERVICE??!!
Workspace: i-i can explain...
I know right
Obviously workspace is a service
ye pls explain
always has been
i forgot to laugh
Wow - the content is coming fast and furious right now - Thank you Alvin for sharing so much. I'm watching each of these multiple times; my primary source of learning at the moment. Much appreciated.
when clicking on an AlvinBlox video, you must quietly ask yourself "Will I be getting Alvin the boy...
OR ALVIN THE MAAAANN??!!"
Video is great even for an advanced scripter. Its always good to know the basics better, your thorough explanations are great!
Cool vid. I haven’t even watched it because that’s how this comment war works.
@Roblox Screen Wait... you can reply... TO REPLIES?!?!
@@poftloft and you can reply to a reply on a reply
@@poftloft It doesn't look like you did, like it isn't indented from the reply but, pretty much yeah.
@@poftloft YESS!!!
Hi
14:41 I'm just going to leave a checkpoint cus I need to sleep and my brain hurts.
like the name, it's clever
This is the only thing so far that I've struggled with. I think this topic is something that you just got to explore around and find useful services for what you are trying to create.
omg finally i really searched on youtube "alvinblox services" and i was sad because there was no result but you uploaded the video today !?! my chance :D
Yes, a new video, a new thing to learn.
Jeez my scripting skills have been better just because of your videos. Thanks man.
Great to hear!
0:50
WRONG!!!
You just defined an object, not a service!!
TO THE VEIWERS:
The difference between services and nearly all other Roblox objects is that services are singletons. For any aspiring developers who don't know what a singleton object is, stop now and google "singleton pattern". This is a very important concept for any beginning developer to grasp. Furthermore, it is one of those terms that will keep repeatedly popping up as you are learning to code. If you don't learn it early on, it is going to throw you off and make things a bit harder to understand each time it does.
Back to my original point, because each service is created as a sngleton, you can only have one at a time. This means that things like parts and players are NOT services because more than one can, and usually do, exist in your game simultaneously.
An example of a service is debris. If you you are creating a part that needs to be destroyed soon after (such as a bullet), you add it to the debris service. This is a special object that the game created when it first loaded up. When you close out of your game completely, the service will be destroyed. The point is that whenever the game is running, there is exactly one instance of this service object.
Every service exists to handle one specific task (or a set of closely related tasks) and do them well. For example, the job of the debris service is to destroy referenced objects after a predefined length of time. Sure, you could write a script to do this or ifnd some other way to do it, but there are drawbacks. For one thing, if you get rid of a bullet but do not properly destroy it, hours later you could have thousands of "ghost bullets" lagging out your server. Even if you implement them perfectly, you just wasted x amount of time that could have been saved by simply fetching that service and letting it quietly do its job in the background.
It is this efficiency, dependability, and ease of use that make services so popular, not just in Roblox, but in most large programming frameworks.
Use of services in your code usually isn't required to make your game work, but their proper use will almost always certainly make it run BETTER. This is why you should all get to know the Roblox API and all of the services that it offers you. When you need to do something in your code, first ask yourself, "Does Roblox have a service for that?" If the answer is yes, then by all means, use it!
TO ALVINBLOX:
There are a LOT of people watching you and taking your every word as law. This is both a privilege AND a responsibility. When you make a tutorial video on a subject that you do not fully understand yourself, you are doing a huge disservice (no pun intended) to them all. Especially when that subject is about a core programming concept like understanding services. Not only will this video potentially set a lot of beginners back in their understanding of the subject, but it will likely result in a lot of games that, at the very least, would have been better otherwise.
I truly am sorry for the negative feedback. I wholeheartedly support what you are doing for the Roblox Community. With that said, I feel it as a duty to my less experienced peers to write this.
Keep doing what you are doing. Your content is usually great. From now on, just be more cautious. Before making a video, be sure that you are fully aware of the impact that it will have on its viewers and on the Roblox dev community as a whole.
Thank you for the content. Keep doing what you're doing. Here is hoping that you always have fun doing it.
Sincerely,
Nate
Hello Nate, you are probably right, I shouldn't have described it as an object. However, I felt that it would make it easier for a new developer to grasp the idea of what a service was, especially after I had looked around online to see if there were any better explanations and many of them referenced services as being objects since they do contain events, functions etc. I should have picked up on that and mentioned that they work similarly with the idea of having events functions but not exactly being the same due to the reasons you mentioned.
However, I don't think my explanation has spread misinformation. This was just a small mistake on my part and I feel it is a minor. I will take your feedback and put it into action if I have the time to make a follow up to this video in the future. Thank you for taking the time to point this out.
Nate thank you for this comment. I've been studying LUA for a few days now and taking notes. I will use this knowledge eventually when I create guns for a game.
The reason why I quit scripting because people with TH-cam videos ,besides you, they teach poorly and makes me feel like a scrub, but because you get into more detail, I decided to script again, and boy am I doing waaaay better than I would imagine.
Wow, Alvin! You've made me thinking how many I have to learn in scripting!
Hii! First comment! Thanks for the next tutorial, love you!
Can't wait to watch the entire series!
Did not understand this that much so I might have to watch it again
Thanks for the series I love it ngl
finally understood the GetService(). Thank you so much
i love your channel dude , it made lua easier for me , couldnt find those kind of tutorials anywhere 2 years ago so i had to go with c#, now i finally achieved my goal ! and all of that thanks to u !
Thanks!
I hope that roblox wil give you a reward for the best tutorial videos of scripting ur the best man
First! I love your scripting tutorials Alvin!
So many videos that came from you these days. Keep up the great work, you are awesome!
Thanks a ton!
I was just.. Not expecting you to answer😅,you helped me a lot learn everything that I know today.
Thank you young Sir. I've seen UserInputService but didn't understand it until you explained
This makes so much more sense!!! Tysm:D epic videos dude
You Sound Much Older Than You Used To Sound, lol. You Help Me Make My Own Games
This guy is the potential to any Dev's dreams.
oh my gosh, your voice has changed so much since the last time I have watched your videos.
4th liker(I think)!!! Waiting to watch more, thanks so much for uploading these easy tutorials!!! :)
Thanks so much for the heart ❤️!!! 🤗
Good morning, looked this up and saw you published a vid!
Alvin: usually names things the name of foods
Also Alvin: names lighting *dog*
every time I get stuck on my game I always watch your videos Keep it up (;
Even in 2x speed you still sound slow, really good to people who never have programmed before
Epic video. I want this information it is very useful to me in developing my games. Thank you Alvin!
This is proably one of the most useful tutorial
Many people left the video
Meanwhile
Legends : Keep learning
Alvinblox: Says something a million times.
Me: *Forgets it*
Bruh
same and its scaring me. I actually want to learn scripting : (
I knew you would have a video on this :D
you make scripting so easy:D
Glad you enjoy it!
@@AlvinBlox bro i tried to learn scripting but its very hard can u give me sloution?
oh ok now I understand. Thanks AlvinBlox, your videos help me so much!
(I'm subscribed, of course)
This video just feels like explaining very deeply in 1 script and not even coding at all lol
I taked 4 days every day i watching a new how to script vidoe SO LONG nice video
Trying to get that last tutorial in before the bloxys
Was gonna skip this video but it is very useful
Can you make a tutorial about how to make player’s last tool drops when getting other tool. And player’s tool drops when he/she leaves. I am having problems. 😀 Nice tutorial by the way!
TenuousFlea I think you should go to the Roblox developer forum.
18:02
*Trying to play some games with us.*
Me: I AINT PLAYING THESE GAMES.
i don't get it what is the point of services what do they do and what kinds are their and i just don't get the reason why getservice() is important and why u use it
Yay more videos
Yes finally first
:o lmao ur voiceeeee has changed wayy too much
btw, what mic u got?
Awesome man just awesome thanks for helping me and other people.
Any time!
Many thanks for all the help with scripting!
You've made it so far, almost to the end
23:38 "We are harnessing the power" killed me lol
Thank you Alvinblox have seen the whole series so far number 20 next.....
I Hope U Will Get So Many Viewers Someday!!!
Make a Video How to Make Street Lights Who Works Only in Night
Services is actually taken from OOP speak. If you take a look at Martain Fowlers book it explains them clearly. Or google "OOP Services". It may help existing programmers to understand them better.
Wheres that Master episode
wait, it's all Service?
*Always has been*
Can you make another video about Events? But make it a little bit more informative and explain step by step? I couldn't understand it that much when i watched your video. Keep being cool my friend, i always look up to you in game development!
What confused you about them ?
great video without you I wouldn't of made a popular game you make great videos keep it up 😉
What’s ur game
Me: my studio is slow bc I got a lot of plugins
AlvinBlox: facepalm*
Nice Video, sure helps me I don't even need to look at my Notes anymore! Also, can you show us how you edit? That would help because I'm starting a channel but I don't know how to edit
Aye I’m early!! I’m still on episode 9 of the series tho :3
keep going :)
Can you make a vid about how to make the game to select a random player? Ex: random killer and everyone else needs to survive
local player
For i,v in pairs (game.Players:getChildren()) do
if i = math.random(1,#players) then
v = player
break
end
end
I'm pretty sure it's something like that
You can make a table with all the players and then do a math.random to select a killer
@Ayesp
does the 'local player' still run even if it's not defined yet? I don't see a table. This variable is kind of hanging.
Ayesp You should put this in a function called selectKiller and create a parameter for what player is selected called “killer”. Set the parameter to the math.random that gets a number between 1 and the number of players when calling the function and then run the loop inside the function to check if the index == killer and then have the function return the value as the killer.
I think this would probably be a better way to do this as it modularizes the code so it can be called more often and can even be used to select a specific player as the killer if needed. Of course the function could be modified further to select multiple killers based on the number of connected players in the server if that is something you want.
Furthermore, I’m fairly certain your example could cause game bugs since the math.random() function is called every time the loop checks if a players index is considered a killer, which could result in every player getting killer or even no players getting killer.
Lastly, your code “if i = math.random(1,#players)” will not work because the game will think you are trying to set the value of i as the condition of the if statement. It’s very common for beginner programmers to get “=“ and “==“ mixed up when setting and checking values of a variable. A handy trick that I do in order to help me remember the differences is that whenever I’m reading or typing the code one “=“ reads in my head as “is” and if theres a second “=“ next to it i read that one as “equal to”.
For example:
local myVar =(is) 5
if myVar =(is)=(equal to) 5 then
print(“myVar is equal to 5”)
end
I could be wrong about some of this syntax-wise since I’m coming from basic C++/C# and Java, and have been watching these videos to better understand Roblox LUA syntax and how to use its services and such, but these are the things that jump out at me when I see that code.
Sorry if I wrote a lot here, I don’t wanna seem rude pointing out all of these things, but I hope there was something you could take away from it all.
Never realized how much I can pay attention. I zoned out at 10 min
I am having problems trying to insert a service inside a function, can you do that?
like when a part is touched, a promptgamepasspurchase appears
after this many tutorials I think that it's time that you make another big game! I think you should cast a vote on your Discord of what type of game you should make a tutorial on
I have some recommendation a for some games you should make: Jailbreak game, Epic Minigames game, Arsneal game . But all in VERY Advanced detail for advanced scripters that wanna make something BIG, Thanks for reading!
yes hopefully a new one of those will be coming soon am working on a new prototype right now
Yay thanks!
Thanks alvin you helped a lot
Your the one who made me a great roblox developer thank you 😊
No problem 😊
Just a question on 18:48 what about the class name? Doesn't that do anything with the lighting service?
May i ask what the software you use to draw is called? It could be useful for me.
who knows python, an easy way to understand Services and GetService:
Services = Modules
GetService = Import
Best teacher ever...
Awesome video! My question is how did the ID of the game pass automatically get converted to a string value and the bool value did not?
Auto-Gen Service is local Service, however local Services mean it is can be accessed by anyone even by struggling connection,
other Services is Cloud Services they cannot be accessed by a struggling connection
Can I ask a question out of topic please. I have a channel (which I upload videos) and I want to know what software (program) you use to do you drawings and stuff and does it have a mac version? If it doesn't no problem, I have another idea.
I love it. keep it up!
Thanks, will do!
Workspace - Store your visible stuff, and characters of the players
Lighting - Change lightning
Players - All the players themself
Repstorage - Visible to both the server and the client, meaning you can access in both local- and serverscript.
Serverstorage - only visible to the server, making it impossible to exploit
Serverscriptstorage - ^
what ::GetService() Does is it basically gets special services that are not inside of the explorer. some of those services are useful for different types of things, For example Alvin used a marketplace service, you can use this service to purchase catalog,gamepass,website Items In game, there are way more services that are useful for different things.
Edit: If you wanted to know what each service Does, then just get the name of the service. then you can either Google it, Or post it asking people what it does on the forums.
thank you!
Alvin I'm thinking of starting to make Roblox Studio Tutorials but I dont have any ideas... Do you have any ideas for me?
CoreGui is removed I believe, I cannot find it inside my explorer?
Nvm I just found out CoreGui is something that needs to be called upon as well nowadays
Alvin the "PromptGamePassPurchasedFinished" event does not work anymore on roblox. Is either that but am really stuck on how to check if user has bought the gamepass, plz help
Hi! Can i ask question when i play roblox studio i can't rotate or move my part im not anchor the part why is this happened?
When you "bought" the VIP gamepass I thought you actually bought a random gamepass but it turned out roblox allows you to test it if you run it like this lol
Wow! 2 videos a day apart?!
I feel smarter after watching this video.
20:21 I am just saving my time here
Why so many ppl leaving tho I remember the first episode had so much views now I’ve reached this episode it hardly has any views almost 20,000
Ppl give up very fast lmao.that’s sad
Cmon buddy! 2 more days and you do a week straight daily uploads! You got this!
Edit: than if you want upload once a month ;)
no promises sorry
You dont have to promise anything ur the best!
I've never seen you talking about something else in videos so can you make one QnA video or something like it?
Wow Alvin your voice has changed a lot
how old are you alvin
Hey its me MrNoobie if u dont know me i was the indian dude my windows 7 motherboard is broken and i cant use my pc so i use my phone
Sorry and hope you get PC access soon!
alvin you cant do roblox studio on phone
@@AlvinBlox Hope for me to change my f*** keybord
i am typing so hard right nw
I am indian too
Arree bhai
bruh he didn't need 40 mins to explain that, basically services are like the workspace, ServerScriptService, or Lighting for example. there are some services that aren't visible like the workspace is. such as the marketplace, and you can make Gamepass prompts with these, if you want that script just skip here: 25:13
Wait,,,,,,,,,,,,,,, Is the client replicator which appears when we test a game a "SERVICE"???
Wait do ur telling me if I buy a game pass and if the have the event as finished, and before I click ok and alt f4 I wouldn’t get what I bought.
Awesome tutorial!
I have a question which doesn't have to do anything with this video. I think. How can you make an item spawner, but when the player picks up the item, it won't despawn from his inventory.(it's for a survival game)
4 vids to go and now onto the advanced yippee!
31:53 ah shit, i have to spend 100 robux another time
You've spent at least 700 robux
The purchases are fake in Play Solo / Roblox Studio and don't count. Look carefully at the GUI and it says it is a test purchase, you won't be charged
@@AlvinBlox i didn't remember, thanks
Hello, how can I put a gamepass in a part, so when the local player touches the part, a gamepass purchase will pop up.
I tried the script below.
script.Parent.Touched:Connect(function()
game:GetService("MarketplaceService"):PromptGamePassPurchase(game.Players,123)
end)
This was the error I got.
12:11:03.140 - MarketplaceService:PromptGamePassPurchase() player should be of type Player, but is of type Players
12:11:03.140 - Stack Begin
12:11:03.141 - Script 'Workspace.Part.Script', Line 2
12:11:03.141 - Stack End
12:11:06.466 - ScriptNavigationHandler : No script currently available.
I removed things because of errors I got.
Dang this old but
script.Parent.Touched:Connect(function(OtherPart) --- part that touched the part
local player = game.Players:GetPlayerFromCharacter(OtherPart.Parent.Parent)
if player then
game:GetService("MarketplaceService"):PromptGamePassPurchase(player,123)
end
end)
The reason your code didn't work is because you're grabbing the parent of the players. We can grab the player that touched the part. Also I wrote this without testing in studio so if it doesn't work it must be a syntax error.
The "if player then" just makes sure the touch event triggers only if a player touches it