Random, Infinite Obby - Roblox Scripting Tutorial
Вставка
- Опубліковано 1 сер 2024
- Discord: / discord
Patreon: / suphi
Donate: www.roblox.com/games/7532473490
Random: create.roblox.com/docs/refere...
DevForum: devforum.roblox.com/t/a-rando...
PCG: www.pcg-random.org/
Wikipedia: en.wikipedia.org/wiki/Permute...
0:00:00 - Intro
0:00:50 - Random vs Math.Random
0:02:04 - About Random
0:05:09 - Infinite Obby
0:17:21 - Damage
0:19:43 - Points
0:22:44 - Overview
0:24:29 - Outro
This video is an amazing example! For most people who want to explore their creativity, this is also how Doors (the horror game) generates each room! Amazing time to post this video since a lot of people are looking into making a game like doors e.t.c good video!
Yes its creativity(Generated)😂
@@akinmaya haha i meant creativity as in branching out in your development skills!
Your tutorials are amazing, they show in detail what the script is about and how it works. Hope to see more uploads from you.
Your tutorials are honestly so amazing, I've never seen such good Roblox Studio scripting tutorials on youtube.
You deserve ALOT more subscribers, hope to see you at 100K subs very soon!
Something i’ve always wanted to learn, but never got around to trying. Thank you, this and your channel are super helpful!!!
Impressive work as always, Keep it up!
Just subscribed 🤗You literally honestly make tutorials about things that i tried to make, like predicting a trajectory or this video for example. Keep the good tutorials up! For me honestly Alvin's scripting tutorials are bad, drawn out and just too simple. Here by your tutorials you learn new things and fun exciting projects!
This might be the best video I ever seen. Very amazing video!
S tier tutorial ! I just discover this channel and it’s the best one doing tutorials on Roblox studio !!
Very good explanation of how to use Randomness in a powerful way , as always you make a very good tutorial that has good information for everyone.
I have a very young step sister who loves to do Obbies and she asked me to make her and her friends a "random obby". I am going to use this video to do just that. Thank you so much Suphi. :)
Very cool tutorial! People can use this system to create things like random dungeon generation, or a game like doors with random rooms.
Your video is really well made and the script is amazing and you explained to me why math.integrate is so usefull!good job!
The goat 🐐This tutorial is so good!
suphi back with the best uploads ever fr
Despite few videos, you are one of the best programmers I know. You can teach in a video how to create an RPG-style inventory. basically the same as minecraft where you can equip armor and so on.
Amazing tutorial keep up the good work!
Thank you
Your tutorials are amazing and you have helped me with making my games! It would be amazing if you could do a tutorial about making a tree chopping system like in lumber tycoon 2, of course you don't have to make a video about it if you don't want to but it would help me so much. Keep up the good work! :)
Very noice tutorial!
Your videos are extremely useful.
Thanks for this amazing tutorial i was able to learn alot of things even tho i am not the geatest developer so thanks!
your videos are really good and contain sooo much information thank you so much for doing these we really appreciate your videos even though some are long, I never got bored. And if u please can, let me know what are the best programs to take in university for game development especially for roblox. I am really into programing lua and 3d modeling/animation/UI/skinned meshes etc, and idk what is best to learn more about all of that. So if u have any idea I would really really appreciate it.
Great video! Can your next video be a tutorial on a grappling gun?
Great video
15:48 I usually sum up the chances of every item and give each one a specific range, then use math.random and take the item thats in that range for example:
- Item 1 - Chance 5
- Item 2 - Chance 5
- Item 3 - Chance 10
then basically you have these ranges:
- Item 1 - [1, 5]
- Item 2 - [6, 10]
- Item 3 - [11, 20]
so if i do math.random and get 8, it means i get Item 2. I think this way its slightly better for memory management
When I have a choice between using more CPU or more memory I normally pick using more memory because CPU is a more valuable resource to me and the extra memory you will be using by storing more pointers to instances will be so small it's not really an issue
Amazing video! I find your tutorials very thorough and helpful for many of my projects! Any chance you’d be able to upload the set of models you made @ 22:45?
Patreon members can download the project in the discord server
Thanks for the great tutorial, I have a question, how about spawn appropriate with player stage after die, I didn't find the code
Thank you for your video. Your video really helpfull. And Would you please to make a video about memory leaks. It makes me crazy...
This is very good.
Now you just need to use noise for randomness, and make a bot to keep creating places with the script along with an auto skip level game pass. Its practically an alternative "Infinite Bobux" method.
Não é possivel, você é dono do roblox! Como que entende tanto desse jeito!! hahahahaha
çok güzel bir video ♥
Teşekkür ederim
but how do i do function that does next(im begginer btw)= when player dies all models destroys, and how do i will like do right the rekord of that player on which stage they died?
You should use this for your game show case to make a dungeon type game with tools that rewards new weapons even free models and a inventory system to choose said weapon, rewards should get better the further you got and show us how to spawn monsters and you’ve got a entire game in a tutorial brilliant work bro I watch these religiously and find it difficult to learn how did you learn?
Item rarities Uncommon, Common, Rare, Legendary
:D YES
Im confused. If we passed the variable ‘number’ in the remote event,why did we use a variable called ‘damage’ and how did the script know its 50 if its undefined
how would i make a highscore counter that saves, because i have tried to make a distance counter and highscore counter and it has worked the only thing that has been bothering for so long is that it doesnt save no matter what i do the hihscore jusst wont save when the player leaves but the points will. It has been so frustrating and i have spent so much time on so i just deleted the highscore counter completly, how do i make it save?
wow very nice tutorial. i learned alot about random.
it is possible to add a checkpoint system?
Anything is possible if you need help you can message in the discord channel
@@5uphi yeah ik my friend :)
i am on my own way to add checkpoint system and more :)
Thank you
i wonder if you will ever do a update to mesh editor to upgrade it and add more function (the one i more need is to be able to make really small build cuz its broken on small one)
How is it broken for small builds?
he didn't speed up the beginning of the video, he's that skilled
bro fr be getting 200wpm
can you make it work from the server side because the scripts inside each segment don't work
Hello! Could you explain how to make a radar with a radar sweep? I’ve briefly come up with an idea: The GUI cone is made by two rectangular parts that just rotate using a script (their rotation may be bound to some physical radar in-game) and all the targets on the radar are invisible, but once the cone and the bleep are supposed to “collide” the gui will use tweenservice to tween its transparency from 1 to 0 and back. I don’t really know how to make it determine whether the cone collided with the bleep or not as they’re both dynamic parts
one option would be to have a mask image the goes over the top and is a inverse of the cone so you can only see the dots where the hole of the image is
@@5uphi damn that’s smart as hell, ty
Hey in my first test the models appear but it seems to only do it once and all the models just stack up in one spot, do you know why?
Hey nevermind i have just seemed to make my start and end 's rotation to be incorrect and making stack up.
you can compare strings with those operators?!
Sick
Very nice tutorial ❤
But the scripts that i inserted to the parts in the obby is not working when it is randomly generated for eg, i made a bounce script and it worked when i put it in workspace but it didn't work when the stage is randomly generated 😕
Oh and also how can you add a timer and when the time runs out obby regenerates
Set the scripts run context to client
Can you do a video about serializing data?
Did everything you said, but whenever I test my game at the 12:33 point in your video, no models spawn in?
same
i figured it out from another comment that suphi replyed to. just use this line instead
local part = workspace:WaitForChild("Start")
@Supergaming-sq5zm THANK YOU SO MUCH THANK YOU THANK YOU @Supergaming-sq5zm THANK YOU SO MUCH THANK YOU THANK YOU @Supergaming-sq5zm THANK YOU SO MUCH THANK YOU THANK YOU @Supergaming-sq5zm THANK YOU SO MUCH THANK YOU THANK YOU @Supergaming-sq5zm THANK YOU SO MUCH THANK YOU THANK YOU @Supergaming-sq5zm THANK YOU SO MUCH THANK YOU THANK YOU @Supergaming-sq5zm THANK YOU SO MUCH THANK YOU THANK YOU @Supergaming-sq5zm THANK YOU SO MUCH THANK YOU THANK YOU
Solution: try to make end and start parts unable to collide)
yo, this is your first obby game? cool video.
The main point of this video is to show you why random is a powerful tool to use and how it allows the client and server to know something without the need of any data to be sent over the network it's a good way to combat lag Imagen if you have a game like Minecraft and everytime you break grass there is a chance you will get seeds well now the client will know if seeds drop without the need for the server to tell the client that the grass dropped seeds
This is a good explanation but for the points part, because there are no checks of any sort you can exploit the points SUPER easily by just firing the remote event, I would put some sanity checks to reassure that it is coming from the actual point touched.
Correct the server can also use the seed to workout what models have points but even if you do this a exploiter could just teleport there character to the next point so you would also need a antihack that checks player movement and make sure they don't fly etc.. obby games can very easily be exploited but to keep the video short I never went into detail about exploits the main reason for the video is to teach you about random and how you can use seed to replicate to clients without the need to send any data over the network
Damn bro how you type so clean bro😭😭 like bro you write so fast without any spelling mistake
Autohotkey
Hello there, I ran on a problem that caused me a lot of pain in the back and I won't rest until it gets solved. It's that I can't share a table across threads (table get copied, it's no longer the same reference. The thing same goes for _G and modules) and it's really annoying as I need it to be so to avoid synchornizing those together, which basically removes the idea of multithreading.
What I want to achieve is to make those two thingies operate on a single table...
Yes that's correct threads cant access the same variables at the same time you have to try to think of clever ways to overcome this fact
damm nice :D👍👍👍👍👍
It works !
I'm kinda late but for anyone who wants to use something like this, I would delete models out of view. Why? Well, it might cause lag since the player could play for a long time. This is what the popular game "Doors" does. I'm not sure how the mechanic would be scripted.
hey suphi, can you make a video demonstrating inverse kinematics? :3
That is on my to-do list
@@5uphi awesome! looking forward to it!! :D
You should show us how to make the models de-spawn when you are at a certain reach too
Use the same function to check the magnitude from the player and then :Destroy() the ones outside the view.
I think you’d have to add a intvalue counter too to the models that counts up each model placed, ChatGPT would definitely help I’m not advanced enough
You can modify the heat beat event or use the function
game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Char)
Char.Humanoid.Died:Connect(function()
--do code
end)
end)
end)
You would have to write the :Clone() function variable for the model outside of the function that spawns them and then :Destroy() them I believe.
How would you go about making a checkpoint for each model? If i were to create it I wouldn’t want people to go back to the beginning
Simply add a touch part and when the client touches that part save the cframe then when a new character has spawned move them to that cframe (this can all be done in a local script)
@@5uphi I see, thank you this is very helpful and amazing!!
@@5uphi Anyway to do individual checkpoints for each player not so much how a player has to go to the checkpoint the guy infront of them is at
This is what i wanted to do. But I am no scripter. Would this be possible with some sort of checkpoint system?
Anything is possible
@@5uphi Is it something you would be able to make? and maybe some more "random" infinite layers on top of this? I have made a "Obby" called "The Runners: Skylines" and I would love to make a infinite version of this. Would ofc compensate for your work. If you are interested?
is there a way to add that 1 model can split into 2, so you have 2 end parts and they both generate the obby?
Anything is possible if you know how
@@5uphi thats the problem, i dont know
You should try the discord channel in the description there are some very nice helpers there
do you know how to make some kind of milestone? like in doors every door 50 is always the same room
Sure
There is one question,The part never destroyed.Will it cause memory leak?
Correct each time a client spawns a instance it is added to memory
can i do this with very little knowledge of coding and help with chatgpt and perplexity AI?
All you need to do is follow the video
can you show how to make a section with its own gravity similar to what jailbreak did with its trains
My fly video shows you how to make anti gravity maybe that can help show you how to use a vectorforce to push the character up
i love this i love this channel but im just curious because when i do the chance it doesn't work
If you followed everything correctly it should work
5:22 what? you have so much images while I have only 11???
How i can make it to work from the server side
keeps saying Start is not a valid member of workspace when it is
Maybe try waitforchild
Why do you generate the parts on the client instead of on the server? Is it because of performance?
So that the server does not have to send data to the client maybe this video will explain why ua-cam.com/video/Ng1uYpFcpOA/v-deo.html
@@5uphi If I make it "server-sided" would a module script be better?
ayoo its cool
Why does my comment keep being removed
Hi, i used this to create randomly generated hallways, thanks! But i've stumbled on a problem - the newly generated rooms intersect with the old ones, is there any way to fix that? i can't seem to find the solution
You haven't moved the 'End' part. I am guessing you stretched the 'middle' part but forgot to move the 'End' part to the end of the 'middle' part. This would lead to the new model spawning in the middle of the 'middle' part. To fix this, just move the move the 'End' part to the end of the 'middle' part.
@@troxinate i meant that the path the hallway takes intersects with itself, like in the snake game where you die if you collide with yourself. I've tried to put rays infront of the end part to check if something's in the way and if there is it'd remove a couple models at the "end" of the hallway and try to generate again, but the ray doest intersect anything (it does but it's unreliably rare)
Well one way is to do a check to make sure there is nothing there before you spawn the model you can use GetPartBoundsInBox create.roblox.com/docs/reference/engine/classes/WorldRoot#GetPartBoundsInBox but this also has the problem of now they have nowhere to go so you need to add multiple paths another option is to just not make your hallways so bendy and more straight then there chance of colliding will be almost 0 another option is the use a grid system instead
@@5uphi thank you!
hey do you know how to make sure it stops cloning its self, and how do I make a obby part only appear once?
If your making a limited obby game then it would be better to not use this video
@@5uphi Can you give me a video that has what I need? If yes can you send the link
and also how do make it so in like the 10th clone it will always add a clone that I picked out instead of the randomly picked one like in doors
♥️
Could I try to implement this using a server script? I understand this was done locally for preformance based reasons but I would like to do this on a server. Im just curious if there would be any problems
There would be no problems doing it on the server side
@@5uphi I tried to implement it today but I had problems getting the player. Can you give me a few ways to get the player server sided? Should I use the player added event?
You can use the player added event
does the seed randomize every time or do you have to do that some other way
5:45
@@5uphi Is that a yes?
can you make a template?
how I PUT A MIDDLE DOT IN THE SCRIPT
i got an error for leaderstats: ServerScriptService.Point:3: attempt to call a string value how do i fix this?
There is a problem on line 3 inside the point script
@@5uphi yes i know but i dont know how to fix it
if you show me your script in discord I can see if I can find what's the problem
@@5uphi ok add me aleksa#0830
Hello, what i need to do if touch script didnt work in generated models
change the scripts RunContext to client this is still a beta feature you can read about it here devforum.roblox.com/t/1938784
@@5uphi Thanks
I really wanna use this for 2 Players at once is there a way to force two players to share a client or do I just replicate for player2..
Interesting I may have to replicate this as a server side script
Random will be the same for all clients so it will automatically replicate make sure to watch the full video so that you can understand how its replicating
@@5uphiis there a way we could replicate terrain with the parts? ❤ love your tutorials you explain complex methods and interactions in a way my brain explains unlike other’s please never stop or leave a full index for me behind!
Add a super donate button to your videos also.
👍
I have a problem that it generates vertically down, not horizontally. How do i fix this issue?
If you show me your code in the discord channel in the description of the video ill take a look at your code to see what's wrong
Why cant i post the code as a reply tho?
code is hard to read on UA-cam on discord you can have syntax highlighting makes life easier plus there are many helpers on the discord channel so if I'm not online maybe someone else can help
if u didnt find a fix to it yet, i think i know how to fix it. check your Start part (the blue one) and see if the Y orientation is anything other than 0. if it isnt 0, change it to 0.
@@Fidumo Sadly, that didnt help.
Keel
How would you make the models destroy when the player is 200 studs away?
If magnitude > 200 then model:Destroy() end
@@5uphi would this delete the models 200 studs behind or ahead of the player?
You would need to check the distance from the front models
Is there a way to do this on the Server Side?
Yes
Do u know why my part C And D are inside part a and b a bit?
And my points don't work
Did you set the start part as the primary part
@@5uphi instead of points could u tell me how to make the checkpoint?
I think someone made a checkpoint system in the discord channel link is in the description
@@5uphi where in the discord
@@5uphi a checkpoint system for the infinite obby?
im getting an error saying start is not in the workspace when it is??????
maybe try waitforchild
@@5uphi i did game.Workspace:FindFirstChild("Start") and there are no more errors, its just not doing anything now :D
Did you try waitforchild I'm guessing it can't find Start
is your channel name related to a turkish film actor?
That is my grandad we share the same name
this would be great for making a backrooms game
Could a hacker change his seed number so it would be different ? Is this hackable pretty much?
Yes even if you generate it on the server side a hacker could delete the parts and generate its own parts you can get more information here ua-cam.com/video/Ng1uYpFcpOA/v-deo.html but at the end of the day the server cannot force the client to do anything on there local computer
No, but let's say we are in a competitive environnement, at least if the server generates the obby obstacles, if the client tries to hack and generate its own obstacles, he would still interact with those of the server and potentially fall or whatever right?
make a infinite obby and use roblox pathfinding to maken an npc walk it
my brain is smoking and on fire, im not okie dokie rn
how can i stop it at a certain stage with a certain level?
simply stop cloning the next stage
@@5uphi epic
it doesn't work even though the code is correct, i've checked every bit of code and it's the same as yours
If it does not work then it's not the same
It said "Start" is not a valid member of workspace, even though it is
maybe try using waitforchild
where exactly do i write that?@@5uphi
@@steampunklimbo I had the same problem but ended up fixing it by using waitforchild(). I put it in line 5 of my local script and wrote this out: game.Workspace:WaitForChild("Start")
Hope this helped
@@GamingWithAro Genius thanks so much. Btw your comment got filtered that's why so many people couldn't see it.
Ah yes, the infinite obby game.
Beat the obby for free robux lmfao
What to do if thats too hard for me
You have 3 options
Give up / Try harder / Pay someone else
hum i have a problem when i load the game it says "Start is not a valid member of Workspace "Workspace"" can someone help me please ?
maybe try waitforchild
@@5uphi ok imma try
@@5uphi now its flooding console saying " ReplicatedFirst.Obby:17: attempt to call missing method 'NextInteger' of table - Client" do you know how to fix it maybe i misunderstood something in the video
Make sure to follow the video carefully
@@5uphiok thanks
Why you use a list compression?
I don't know what list compression is?
@@5uphi like, drawing a code in the same lane. ( Sorry for my english im spanish). For and end in the same lane. Not pushing enter and bleeding.
its just my personal style feel free to code anyway you preferer
@@5uphi okey tnks :)
why doesnt it work from the first test?
You must not of followed the video correctly
@@5uphi I did exactly what you did
Double check there must be something that's not the same
wow you type fast