Это видео недоступно.
Сожалеем об этом.
Beginner's Roblox Scripting Tutorial #14 - Instances [FIXED] (Beginner to Pro 2019)
HTML-код
- Опубликовано: 18 авг 2024
- Beginner's Roblox Scripting Tutorial #14 - Instances (Beginner to Pro 2019)
HEY GUYS! I'm actually back this time and in today's video I am teaching you about instances. Like always if you have any questions please leave a comment. Anyways uploads every other day starting now! ENJOY!
Link to Beginner's Tutorial Series:
• Beginner's Roblox Scri...
-- Follow me on twitter! (my name is tapwater because thats my main channel): / realtapwater
- Join my Discord Server to learn and meet other developers!-
/ discord
--What is this series about and who is it for?
So this series is meant for people who really want to learn exactly how to script, if that is you then I promise by the time you watch this whole series you will know exactly how to script on roblox. Anyways be sure to subscribe to see whenever I release a new tutorial and I will see you guys in the next one. Peace!
Hey guys! Be sure to join the discord server if you have any questions or if you would like to meet me! discord.gg/FKcSyRh
why i can't join to your discord server? :|
Hey @TheDevKing, I know this is two years later but is it any different moving the part in the script with instances than moving it with the properties tab? Also if you could add me on discord PixelWolf#7206 I got banned from RoDevs last week and I wanna talk about it with you.
@@Molnuts_ e
that is really cool bc you i know how to script and im scripting a game for a youtuber thanks!
it wont spawn in the part and heres the script i did: Instance.new("Part", game.Workspace)
Why is he so underappreciated? The guy deserves to have a million subs, he's so humble, and makes clear points, INSTEAD of having this mic down his throat. Also having NOT those annoying clickbaity thumbnails.
@the epic sus what do you mean look at the thumbnail?
@@HashtagMaster he was talking bout his main channel, TheDevKing isn’t he’s main
@the epic sus ohhh, that’s why he wears tap water shirt. I thought he was just a fan of him lol
which recording app is he using
Thedevking is so good at explaining. The only reason I know about scripting is because of him
Almost finished the beginner tutorial and so far I've understood everything. Can't wait to move onto the advanced tutorial!
Same!
same
@@existenceinquestion. how are u at scripting now
@@Fc-ew8gx im learning at the advanced tutorial
@@existenceinquestion. Nice man i just learned how to script a walkboost pad myself im happy
it feels so rewarding to know that you haven't given up and nearly finished the beginner scripting tutorial
Oh I called the Police twice to check to see if you where still around ABOUT TIME YOU CAME BACK
BloxTech Studios LOL you’re joking right?
@@TheDevKing hes totally not joking
@@TheDevKing not joking =0
@@TheDevKing no
local notjoking = true
omg, learnt so much from this vid, I have watch every previous tutorial but this one is by far the one that make me learn the more. I got so many ideas in my head of games to do just with this tutorial. thanks bcuz if u wouldn’t do these tutorials I would still be toolbox nerd and before watching ur tutorials I couldn’t even make a frame
Because of these tutorials, I’m making things I never would be able to make a week ago. You truly are and always will be the dev king!
Yes he is
i also made a rain destroyer so the rain gets destroyed when it touches the ground
local plate = game.Workspace.Baseplate
plate.Touched:Connect(function(hit)
if hit.name == "Rain" then
hit:Destroy()
end
end)
EDIT: And 30 seconds later i realized the next video is about that xD oh well it was fun finding a way myself
Lightmare lol i tried that but it didn't work
or you can just set the rain parts CanCollide to false, that way the rain will fall thru the ground.
@@apisangunathilagarajah8877 more lag
@@apisangunathilagarajah8877 Boi, the parts will just fall through roofs, it won't work in real games. The parts will also not go away and if a server runs for a while, there will be so many parts it lags.
Or just replace that with wait like
Wait(time here how many seconds it taked)
game.Workspace.YOURRAINNAME:Destroy()
Hope you understand
Because of you, your the reason I've gotten so much better at scripting. I am so fortunate to have you make videos on these subjects so inspired creators can be much better scriptors. Thanks for everything!
That's actually so cool dude!
Hope to be just as good as you one day :D
Hey I know I'm super late but I'm currently learning scripting and I'd love to give this tip to anyone learning using these tutorials. Once you finish a tutorial, give yourself a mini task associated with the lesson, and also try to connect it with concepts from previous lessons. It really helps! For example, after I watched this tutorial I was able to successfully make a script that made it so that when a player touched a part, rain would spawn and it would print "It is raining!" Simple things like that make learning a lot more effective and allow you to understand concepts better.
Can you share the script so i understand how to do it because i havent done it it’s actually pretty hard
@@shxrp.ff2 This one is kinda buggy but it works,all you have to do is instert a part into workspace and keep the default name,then make a script in the workspace and type this code
local CoolPart = game.Workspace.Part
local function StartRain()
while true do
wait(0.1)
local Rain = Instance.new("Part",game.Workspace)
Rain.Position = Vector3.new(0,15,0)
Rain.Size = Vector3.new(0.5,2,0.5)
Rain.Anchored = false
Rain.Transparency = 0.5
end
end
CoolPart.Touched:Connect(StartRain)
@@shxrp.ff2 Here it is with Comments
-- define Variables
local CoolPart = game.Workspace.Part
--Tell the game what the function does
local function StartRain()
while true do
wait(0.1)
local Rain = Instance.new("Part",game.Workspace)
Rain.Position = Vector3.new(0,15,0)
Rain.Size = Vector3.new(0.5,2,0.5)
Rain.Anchored = false
Rain.Transparency = 0.5
end
end
--Run the function when you touch the part
CoolPart.Touched:Connect(StartRain)
That was funny lol best tutorials. "Script on" LMAO 😂 9:04
It's been a little confusing but I think I've got it up to this point..
Nice! Plz ask any questions you have.. I also have a discord server discord.gg/FKcSyRh
Listen, these tutorials are poorly structured and miss out key things. I recommend learning a coding language such as Lua or Java the language BEFORE learning an API such as roblox.
Bullshit Department I’ve learned a little bit of Java enough to know that it sucks to learn. You have to define everything and stuff and it’s just not fun.
@@bullshitdepartment lol im starting learn roblox coding and i am loving it XD.
@Marcus Varisco sad?
This was, like you said, a really cool video, thank you so much your an og. It was refreshing learning how to do this :D
I'm gonna start this vid tmr because I already saw the ones before this and I'm tired.(btw TheDevKing, your really good at explaining things and so far I get mostly everything you've taught me.)
I just did something I never thought I would be able to do... I solved a problem in a script without looking anything up or getting a free model. Thank you so much dude! I made my own landmine today.
Your laugh makes me laugh LOL
😂
"hope you enjoyed it" Yes... i enjoyed it...
XD
fun tip for rain in roblox studio (you dont even need to know how to script):
1. Add a part to workspace
2. Add a "Particle Emitter" to the part
3. Adjust the size of the part to the area you want the rain to cover
4. Adjust the settings of the particle emitter until it looks how you like
5 Tutorials left then I go into making Gui's and learning what the do and there functions but these Tutorials have been the best and is helping me reach my goals this is really great keep up the good work TheDevKing.
You are a really great person and I owe you my Career @TheDevKing.
theres the advanced playlist also watch that
liked. subscribed,shared, absolute amazing tutorial. keep on entertaining viewers because you are quite good at it!
(i suck at complimenting if you couldnt tell )
Wow W! Amazing thank you so much!! Just started 3-4 days ago already know how to write functions,variables,if statements,else and elseif statements, built in functions,Events!!! Thank you!!
I just want to thank you because I am a really good scripter now and that’s because of you!❤. Thank you!
Dev king every script tutorial: “Hey guys I know its been 6 mOnTH SiNcE i LaST upLoADed”
Yo these tutorials are low key makin sense tho
did he pay you to say that😂
I figured out how to make the rain drops look like they splash(They get spawned and get deleted after one second) it looks so good it could be used for some game! Would only work as real rain if the size was a little more smaller and it wouldn't hit players(Just go through them) but this couldn't be used on a large map since the game would crash because of the amount of rain drops falling.
hey there stranger. just wondering if u wouldn't mind sharing your code on this script?
just make it cancollide false
I also did the same thing but changed a few things. Script:
local function ModifyPart ()
local Part = Instance.new("Part",workspace)
Part.Position = Vector3.new(math.random,200,math.random)
Part.Transparency = "0.5"
Part.Size = Vector3.new(1, 0.5, 0.5)
if Part.Anchored == true then
Part.Anchored = false
end
end
for i = 0 , math.huge do
wait()
ModifyPart ()
end
Can't you just do Part.Anchored = false instead Part.Anchored == true then
Part.Anchored = false?
@@overseer_the_engineer Yes. I assume he simply wanted his code to be long.
i changed the size to Vector3.new(0.05,0.02,0.05) and it looks about right size wise. love doing actual useful stuff btw TheDevKing
in 4:09 you should assign parent last, i learned that its much better for performance
i leave this tip for others :3
instead of:
local NewPart = instance.new("Part", game.Workspace)
(code)
do this:
local NewPart = instance.new("Part")
(code)
NewPart.Parent = (ur parent)
Loving the tutorials I cant wait to create my own game!!
I actually hooked the instance. new part with a click detector on a block so the new block auto spawns like normal but if you go to the block with the script in it and click it, the new block changes to a random color. that was my first instance. new script that actually fully worked on 1st try without testing
How did you hook it with a click detector?
@@overseer_the_engineer maybe he typed another instance and make that instance a click detector and set the instance parent in the parameter to the new part
00:08
TheDevKing: I know its been so soo Long...
Me: Binge Watching whole playlist in 2023
😎😂
sameee
Ik i'am very late, but just saying, every video, the videos decrease, for a example.. 2 vids ago he was on 14k, now 8k... So alot of people gave up, so anyone seeing this you are Veerrry close till completing lua! And keep on going,
Thank you :)
Made rain that kills you and it disappears when it touches the baseplate. :)
(You might want to make the area smaller so it's harder to dodge)
Code:
local n = 0
while n~= 200 do
local x = math.random(1,50)
local z = math.random(1,50)
local y = math.random(1,50)
local rain = Instance.new("Part", game.Workspace)
rain.Size = Vector3.new(.5,.5,.5)
rain.Position = Vector3.new(x,y,z)
rain.BrickColor = BrickColor.new("Really red")
rain.Material = "Glass"
rain.Transparency = .5
n+=1
wait(.5)
rain.Touched:Connect(function(plr)
local hum = plr.Parent:FindFirstChild("Humanoid")
if hum then
hum.Health-=10
end
if plr == game.Workspace.Baseplate then
wait(1)
rain:Destroy()
end
end)
end
while true do
local x = math.random(1,50)
local y = math.random(1,50)
local z = math.random(1,50)
local rain = Instance.new("Part")
rain.Parent = game.Workspace
rain.Size = Vector3.new(0.5, 0.5, 0.5)
rain.Position = Vector3.new(x, y, z)
rain.BrickColor = BrickColor.new("Really red")
rain.Material = Enum.Material.Glass
rain.Transparency = 0.5
rain.Touched:Connect(function(part)
local humanoid = part.Parent:FindFirstChildOfClass("Humanoid")
if humanoid then
humanoid:TakeDamage(10)
end
rain:Destroy()
end)
wait(0.5)
end
thats cool thanks for the code im gonna use this to teach myself a little bit of scripting
how are ya'll makin this?? im on this part too and so far I understand it mostly but I couldn't even think of these
@@juhp9068 self coding is a good way to learn if you give your self ideas or project
dang that old leaderboard is so cool...
For some reason its not spawning a block and i have the exactly same code
Sameee
So true it’s not spaning
Using instance.new would there be a way to make it so once you come to the edge of a block a new block or part spawns in? Almost like an infinite landscape that loads as you go.
Quionew you could do when the part is touched destroy it and then put the position of the new part
im not gonna give you any source code, but you could easily do that by finding out the x + z position of the player, checking if its near the edge, and if it is then just duplicate the part that the player is standing on and change the position based on the players current x + y. put this in while true do and then you have infinite terrain. (keep in mind i came up with this off the top of my head, so it may not be entirely optimized)
use TouchEnded event
he bacc to attacc
if you want the rain to fall in different places every time then change the x and z axis to math.random(number1, number2)
I have reached a new level of scripting. Where the character in the thumbnail is wearing a red shirt. I have officially made it guys
Ok this is my favorite one yet. I’m a truck driver learning while I’m in my office
Thank you:D, i am new trying to learning this script, my brother know the script but he have to do homework and he is learning C#
"It rains forever over here" Also DevKing "I don't know how rain looks like." 😂😂
love how the thumbnail says "instansces" LMAO. great vid
Every video I watch I hear you say I'm back for good lol
My man is flexing with his new ⚡🌞🔥🔥🔥☄🔥SKIN 🔥☄🌞⚡
local function NewPart()
wait(1)
Instance.new("Part", game.Workspace)
end
while 3==3 do
NewPart()
end
this will create a new part every second
ty this was very fun to make and i changed its properties tysm
while true do
local Part = Instance.new("Part")
Part.Parent = game.Workspace
Part.BrickColor = BrickColor.new("Bright red")
Part.Size = Vector3.new(10,10,10)
local Smoke = Instance.new("Smoke")
Smoke.Parent = game.Workspace
Smoke.Opacity = 35
Smoke.RiseVelocity = 25
Smoke.Size = Vector3.new(10,0,0)
print("Best tutorial ever")
wait()
end
--thanks for the tutorial!
--i made a volcano as well so the parts would fly out of it whenever i ran it
I found out how to teleport sombody :D. The script is
local Part = game.Workspace.Part
Part.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
hit.Parent.HumanoidRootPart.Position = Vector3.new(29.7, 0.5, -293.3) -- Put the position what you want there
end
end)
@Minify ik, but it was pretty good for me back then
Things are so simple usually when he explains it!
im french and i learn a lot with ur video
"I won't leave you ok, not this time"
- My da-I mean TheDevKIng
TheDevKing Teaches Like The Best Teacher. Keep Up The Good Work Man! I Even Made A Automatic House When I Spawn.
you can make a assault rifle with this by hooking the rain up with mouse
Ngl I skipped the last things, Will this hurt me too much? I just didn’t feel like doing it at the moment.
i mean kinda, its like the very basics of scripting
Dude. Watch the whole thing.
Thnx man I learned a lot
5:59 why it's funny
Im close to finishing the begineer tutorial and so far i understand everything except returning.
4:33 Is The Best
A seat? I though you would create a hot dog
The last bit where the rain falls is like the iron generator on bedwars
Person: Tell me something cringy.
Me: *script on*
thanks to this tutorial i have learned to make a part run across the floor
XD
This is getting more advanced
Thank you so much!! :D
Not trying to be offensive in any way, but I prefer to do "while wait() do" since it works the exact same way as "while true do," except you don't have to put the "wait()" function at the start of the code. It's a lot better.
9:10 I'm laughing too much
3:10 that explains why waitforchild exist
How would i make it so i could use the instances in a function? like i did
Rain.Anchored = false
Rain.Transparency = 0.5
Rain.Size = 0.2
while true do
wait()
Rain
(there was a bit more but this was the gist of it)
Just add a function and inside it do all of what he did and fire it
I remember builders club. I had OBC. Like this comment for builders club back in roblox!
@IceCraftroria right and now you have to pay 10 rbx to make a shirt which sucks lol.
Ur the best u at least don’t have like super loud intro it’s too old school but keep it up I like u
ye
And what you were trying to say was 3 value axis
After this series I'll go on to advance scripting. :) :
local NewPart = Instance.new("Part", game.Workspace)
NewPart.Material = "Metal"
@@mmaxo wow do you know how to code? cause if I have a good internet I might add you to make games cause I still haven't understand coding so would you like to join in the future the success have high unsuccessful rate but still
❤Love from France
*3:14*
Message of the day: "First thing first though when you do create inssssancesss"
THANKS SO MUCH MWA
The comment section under these videos are more helpful than GitHub
For some reason when I typed in
Vector3.new(3.3.1)
It caused an error..
Please help!
u might need to replace the . with ,
if that doesnt work put a space between each ,
3, 3, 1
by far I dont wanna create a game instead I wanna see most of your videos doing fun stuffs by scripting HAHAHA! thats crazy right?
my game crashed when i tried to make rain this way
OMG thank you!
you can change the video playback speed to 1.5
what can instances be used for
bullets
mans made a whole lag tester using this tutorial
this one is sick
first
DevKing: I don't know what rain looks like
Me: This guy lives in Arizona
yes xd
1:20 Time stamp for myself :)
I did everything u did
no one talking about the fact he spelt "Instances" as "Instansces" in the thumbnail?
i made a bath of glass lol
last video: I know I've been gone for 6 months but i promise i will upload more
next 2 months: *cricket noises*
TheDevKing: lets change it to 50,50,50 him: whata TheDevKing:what about 50,200,50 whata oh its not ancohred
Maddie Milky I Agree
Again the rain didn’t work for me
studs are still there! normally roblox removed studs but if a instance of a part comes it is with studs!
gg
im using these tutorials in 2024 lol