Это видео недоступно.
Сожалеем об этом.
Beginner's Roblox Scripting Tutorial #13 - More Events (Beginner to Pro 2019)
HTML-код
- Опубликовано: 12 апр 2019
- Beginner's Roblox Scripting Tutorial #13 - Events (Beginner to Pro 2019)
Hey guys, I AM SO SO SORRY for not uploading for 6 months I honestly just forgot but I will not be leaving again I promise! I hope you guys enjoy the video and If you have any questions you already know leave a comment. Anyways 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
dev i dont know why mine is not working
nvm THANKS SO MUCH!!!!!!!
Didn't even notice you were TapWater lol, sorry.
@AustinGaming If you have a model named bob, with multiple blocks that make it. If one of the blocks is called jeff. then bob is the parent of jeff
Sorry dev it’s expired
These tutorials are the best ones I ever saw. So many knowledge gaps of mine have been eliminated. And it is such an honor to hear that heavenly "Oof" again.
i agree
God I still miss that sound
it still exists. *as a high pitched sound*@@frownyee
surprised you didnt call the part hotdog lol
he's grown so much after 6months
Yes he forgot hotdogs and moved to hamburgers
Omg I just realized I made this comment lmao, I’m joshua h on my yt account
@@UnusefulGaming Yea ive heard people get from complete begginer to absolute legend in 6 months
Classic
I will be uploading every 2-3 days! I hope you all can learn from these tutorials and like always if you have any questions leave a comment!
Hopefully I don't seem like I'm rushing, but it has been 13 days since you last uploaded is anything going on?
@TheDevKing where are you
TheDevKing what’s the discord server
It's may 6 are you sure about that
a month has passed where are u >,
What have I learned so far:
DevKing REALLY likes hotdogs
The tutorials are epic
I am actually learning what I dreamed of learning when I was smaller
Hello have you learned lua now? not asking for a script or anything i just hope u learned lua cuz uts ur dream :D
I learned Lua but then stopped coding for like 2 years :(
@rabbitspaceagency704 Sorry for the late response lol, actually right now I am re watching the whole scripting series again because I was kind of inactive learning Lua for a few months, but right now I am back on track! It's a lot easier learning it now when you have watched the tutorials before. :D Thanks for asking
@@DatToxicGuynice :D good luck!
@@DatToxicGuy damn
These types of tutorials to learn scripting are the best. It’s so real and knowledgeable, and whenever he messes up he doesn’t edit it out or anything which is amazing because it teaches you different things to not do as a scripter and teaches you that your gonna mess up and there’s always a solution. Amazing DevKing
I would recommend when doing these tutorials to keep track of everything in a journal/notebook. It really helps for later on if you forget anything you can just look back at the journal and see how to code a function or something. These tutorials have brought me into the coding world and I think they are great! Thanks!
what i do is similar. i script everything he says a few times on my own to practice until i have it burned into my memory in a test game, and i figure if i forget i can reload it later.
my friends and I have a whole group for practising coding
hows your scripting journey been
what I do is try to make my code a little bit more different like changing the names and the values to atleast know that it works for everything, I used to write notes but then I lost the notebook
I just tweak and play with it in studio, renaming things.. and i just put it in my head it’s ez
Amazing videos! I am only 11 years old and I could follow along with your script just fine!!!
Edit: 14, im 14 now
Edit: Im 15
Edit: Im 16 😎
*meanwhile you think this is a print script*
Official Term 😂
same
@@calen3595 Same i am 12 rn
@@certifiedhoodclassic638 oof
Start: ok guys it’s the dev king here back with a daily video
Little while ago: it’s the dev king sorry I was gone for like 4 days but I’m back and will never do that again
Now: *hello guys it’s the dev king here sorry I was gone for like 6 months I’m so sorry I’ll never do it again*
Hes pulling a coryxkension
Lol
Stop complaining
@@Xerlxyz he is not complaing
Next time it's 5years lol
I’m coming back from the grave and learning to script when I was 12 I failed a few months ago I also just gave up due to lack of motivation but here I am again and I’m proud of what I’m starting to actually use and be smart
Facts man, same😁
ikr? I use to go on a bunch of scripting tutorials and just clicked off due to lack of motivation.
Same!
Are you still going?
lol i just get distraced lol
This is my favorite script you have taught me in this series so far!
Mine too lol
btw it does matter what you set the hit to, if its anything else, the game wont know what your talking about and it will print a nil whenever you touch it, so experiment with it and see if you find anything different than what i said.
You can change it to whatever you want to. Hit is just what most use but u can set it to Hotdog and it will still work just fine. I hope this was what you were talking about
don't know if roblox fixed over the years but you can see that anything works now.
Is hit a fuction? Because when i typed the same thing that he did, it did nothing i only changed the Part because i changed the name of the object to Granitepart
Hit is a built in parameter. So unlike normal parameters which you define the variable in the function and set any value when calling the function, parameters linked with events are set by roblox. You can name the variable whatever you want just like normal parameters, but it returns a value when the event is fired. For touch event, I *think* there is only 1 parameter, which is the part that touched the part that had to be touched to fire the event. So when the event is fired, it returns a string value to the hit parameter (or whatever you named it) of the part that touched the part that had to be touched for the event to fire.
A players character consists of many parts like “RightLowerLeg” and stuff like that. Also, players are the only objects that have a humanoid as a child. So if a player hits the part, the hit parameter will return the body part that hit the part, and so hit.Parent is the player, and if finding a humanoid is true with the hit.Parent, we know for sure it’s a player, because of a random part hit the part, it would not find a humanoid in the part’s parent.
Events were the most important tutorial when you uploaded that video. I hope this video is even better because last time you made this in a video it was one single event
6 months
man you beginner scripters have so much dedication
*respekt 200*
Notes: (its a long one!)
Script.Parent is the patent of the script
The event touched will fire when the part is touched by a different part in game, and it will run a LOT if you were to touch it, since players are made of many parts
A way to connect a function to an event is:
[the name of your part].[the event]:Connect([name of your function]()
And if you were to use a parameter in the () then what fires the event will be stored in it.
Example:
Knee.touched:Connect(Bee(tea)
Then the part that touched Knee will be Tea
So if you were to use (tea) later on in the script, the script will see tea as what touched knee.
Example:
Imagine that your function is
Print (tea)
When you fire the game, and something touches knee, the function will fire. But instead of printing tea, it will print the name of the part that touched knee
If you wanted to make sure that the part that is touching knee is a player, then you would need to do this:
If tea.Parent:FindFirstChild(“Humanoid”) then
[And here you type the code that happens to the player if the player touches knee]
End
Let me explain;
Humanoid is a part that only players have
So findFirstChild(“humanoid”) looks for a child names Humanoid once. If its there, the function fires, if its not there, then the part is not a player, and the code doesn’t fire.
The reason we type tea.Parent is because players only have one humanoid part which is the direct child of the player. The part that touches the part isnt the player itself, but the limbs (aka the parts in the player) and there are no parts called humanoid in those limbs. So instead of looking for humanoid in the part that touched knee, we need to look for humanoid the the parent of knee (which is the player in this case)
Thx for explaining, those helped alot.
using a body part as your "Part" name is a little confusing for some people(me) but i got the hanged of it and that helps thanks my dude
Thanks for breaking it down dude
Man, you're a lifesaver with those -15 minute vids bro.
*timesaver
are u a pro scripter now? or at least good at scripting. Just asking people to see if they didnt give up
this far into the series and i am managing to understand everything, it's so cool, always wanted to learn scripting but only now it's kicking in
Haha right when I figured out I could edit my avatar while playing in studio I deleted my legs 😂
rip legs
@@shotab8758 😔
@@joshuajurado939 ?
@@shotab8758 its an emoji basically saying: sigh
me when making ghost :
Hi Tap,
I just wanted to say that the fact that you don't want to edit your videos actually makes them easier to follow lol
actually it kind of does, in a moment when all of us would be confused, we're confused together lol. instead of him cutting straight to a correct version of a script and slightly confusing us more
i've always wanted to make a game and have the power to make updates according to my will, because i see games out there that i like but they just take the wrong turn when they make an update, so when i make my own game this series would help me make it and expand our community in a positive way, thank you so much for taking your time to enlighten us newbies about coding and all that, it deserves a sub!
What type of game are you trying to make
rpg
so far i'm only struggling with the map, but i shamefuly started out by using a game kit that mimics the style of the type of game that i wanted to make, but then later on i started learning how to fix any bugs that might of happened, and configuring scripts to my will. not to the deep point but just changing some variables. Now i know a little more of what to do and might just try making my own game without any kits or help. but the first game i used that had a kit, is pretty much done. with the exception of the map. the first game's name is undertale robo mania, but the second game is still work in progress.
@@the_waterpearl7517 noice
saaaaame
@@the_waterpearl7517 Its been a long time since you wrote this, so how have things been coming along?
“its been 6 months im so so sorry”
me watching 4 years later: you’re forgiven.
Thank you for showing me the object browser it help me to know some codes and know what they do.
And you explain every single thing we didn't know. :)
events are my favorite subject
I have watched 7 different tutorial RUclipsrs for scripting and not one explained what everything they type does and what’s its for. Great tutorial!
if you are watching this through the playlist, you are 1 episode before the red sweater 6. the last 6 episodes (where the thumbnails show tapwater wearing a red sweater)
I'm going to make a little script about everything i learned:
local hotdog = "thanks for everything devking"
print(hotdog)
local hamburger = 2
if hamburger == 2 then
print("yesss")
end
game.Workspace.Baseplate.Anchored = false
wait(2)
game.Workspace.Baseplate.Anchored = true
Ik that's almost nothing and it may e wrong but ty for the help dev king
you can also change other properties like color, transparency, collisions, and more
I think it's correct
has he moved from hotdogs to hamburgers?
I dont know how your supposed to suck a hamburger...
another thing is when writing it hit.Parent.Humanoid.Health = 0 for other games that decrease health when you touch like lets each time you touch it it decreases half of your hp you can do hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health-50 if you -100 you die -50 you will also die because theres alot of parts of your body touching the part so this is just a thing i found
The Dev King : Hey guys it's the Dev King here
YT : Hey guys it's an effing here
TYSM, THESE TUROTIALS HELPED ME A LOT TO FILL IN THE GAPS I HAD IN SCRIPTING =D
these are the best tutorials i have ever seen
thank you for this tutorial man i was able to make a Heal version
local HealPart = script.Parent
HealPart.Touched:Connect(function(heal)
if heal.Parent:FindFirstChild("Humanoid") then
heal.Parent.Humanoid.Health = 100
end
end)
I like how you made the same mistake on the last events video with the parenthesis
THIS IS THE EPSIODE I NEEDED
4:09 I SWEAR BRO WAS GONNA WRITE HOTDOG
This video helped me learn findFirstChild so well, thx so much DevKing!
he probably spent 6 months getting rid of his addiction of hotdogs lol
when he does the kill thing how does he set a parent to the parameter hit.parent:FindFirstChild("Humanoid") how does something become a parent of a parameter??
12:12 man I miss that sound so much 😢
why we need :connect (funcition() when i use the code
local part = script.Parent
part.touched:connect(funcition()
print("HI")
end)
i am new so i don"t know:))
@Animaytics thank you:>
@Animaytics hey can you add me on discord, thank you for your help my discord is Riryo#1652
Leaving comment here so I can get the answers
@@MichaelR1275 Ask away
i am learning so much thanks for the tutorials
Whenever I tried to do to touched it did not automatically show it and whenever I tried to go in to step on the part it said touched is not a valid member of workspace
Can u begin making ingame examples?
Thank you so much! I learned alot from your videos
how did scripting go for u
are u a pro scripter now? or at least good at scripting. Just asking people to see if they didnt give up
I didn’t know how much I already knew about Roblox scripting until I skipped almost 90% of these tutorials due to already knowing them 😅😅
There's an erroer where apperently "Touched" is not a child of Workspace and the prgram won't work when i touch the part
I had that problem too, the script has to be a part of the part and not be in the workspace
The old oof sound brings back memories.. 🥺
How would you code the touched part to make it where it can only be touched one time, regardless of how many times the player steps on it?
yes how!?!?!
@@frostyhalo I actually just figured this out the other day! You need to add a 'debounce' to the code. Here's a link that shows how to do it!
ruclips.net/video/eyQ11rXzee4/видео.html
@@theartisticfox9050 Thanks man!
you can use the IF command, ie. IF status == untouched THEN status = touched (continue your code here), so once the code is fired, your status will change and the next time it gets fired, it wont get through the "if"
cant still believe i was able to learn this much at scripting within 3-4 days.Thanks so much TDK.Respect bro and keep up and the thing is i am 14 yrs old("ik i am pretty old but lolololooloolol")
you're a fetus you're not "pretty old" wtf
@@QUBIQUBED i literally laughed at that
Thank You Devking for making these awesome videos!
I have been speedrunning this series for 45 minutes, i think i actually learned nothing though because i already knew all it
I have done the hamburger part of the video exactly as you have, yet it still says "Hi" from touching the baseplate at the beginning of the test. Why is that?
Oh, I see. You moved the part up so that it wasn't touching the baseplate.
Made a kill brick for the first time without copy/pasting! I still needed help from the tutorial, but I did a lot better than last time I made a kill brick :3
This is my favourite part of the tutorial 11:00
i just noticed this was uploaded on my birthday
3:44 that explains why one of people i know in discord made a script to make it damage 14 but when you touch it it one shots you
More consistent schedule plz, your vids rlly help me.
are u a pro scripter now? or at least good at scripting. Just asking people to see if they didnt give up
@@JOEEDXCSDF Unfortunately no. Long story short, I ended up finding a hobby/work skill that interested me more (Welding) so I went to school for that and now that’s what I do both as a hobby and for work.
@@glorifiedelement oh, sick
Thank you so much you helped me understand coding so much more.
👍
Made a script that opens the door when you say something. It's like guess the character :)
local door = script.Parent
local Players = game:GetService("Players")
local function doorSystem(t)
door.CanCollide = false
door.Transparency = .5
wait(t)
door.CanCollide = true
door.Transparency = 0
end
Players.PlayerAdded:Connect(function(plr)
plr.Chatted:Connect(function(msg)
if string.lower(msg) == "mario" then --This makes it so players can use uppercase or lowercase
doorSystem(1)
end
end)
end)
epic
this series has been the most informative than any other thing I have watched even the one roblox itself made
are u a pro scripter now? or at least good at scripting. Just asking people to see if they didnt give up
@@JOEEDXCSDF ha, I've completely given up on roblox now lol. However I still do programming and game dev, just in other engines now
@@gamerlyf9979 ohh right lol goodluck
At 7:10 I was like "Did I just have discord open?!?!"
bro you are great at explaining things
Very good video. Just a question . How I make the same BUT a message appears when I have touched the Part ONLY with LeftFoot?
So you want it to kill you only when you touch with your left foot? If not, please explain so I can help you out :)
@@xealmcreepypastas4361 Thank you for replying. I have found the answer ! Cheers
1:30 fun fact you can say part.transparency 1 so it is invisible lava part so people will step on it and BOOM it is NOW A TROLL OBBY
Hey thanks for these videos they help a lot!!!
to all the guys from 4 years back, we have got words like "rizz"
this is helpful im making an obby thanks
instead of
hit.Parent.Humanoid.Health = 0
you can do
hit.Parent.Humanoid.Health = hit.Parent. Humanoid.Health - 10
this will damage you a bit when you hit it, instead of instantly killing you
If you wantit only to fire when your intire model body touches r you can check for huminoid child hitting the part
I tried to join your server to start learning how to script, when I asked something in the scripting help channel they just said I was asking basic stuff and that was not the topic of the channel because I was asking basic stuff.
You said that we could join the server if we had a problem (even a simple one) and then ask for help, but if you said that why would people from your community treat a beginner like that? That makes no sense.
I can help you if you need any
People are people. Some are toxic and leading other people to be toxic. Just how it is. If you need help, you can ask me. I am not an expert but i know enough to understand it
times have changed, this video was posted 1 year ago
hey dev! i love your videos. I have a question, how do you move from one frame to another? like when you press play, i want to go to another menu.
example : button.mousebutton1click:connect(function()
frame.visible = false
frame2.visible = true
end
Jennifer J a bit late buddy
Aixryl
At least someone responded with an answer. Be a bit considerate and give the guy some credit.
how did scripting go fo ru
@@Real_AgilityYT terrible
I haven't heard the Oof sound in years lol!
i never knew the dev king was tapwater
i made a script that takes away health instead of instantly killing you :D
local part = script.Parent
part.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - 5
end
end)
I tried it but i couldnt figure out how to make it not insta kill you any help?
@@MrSaladBoi You could try to add a wait(1) or something underneath the hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - 5.
12:14 THE OOF SOUND 😭
I wanted to try remaking the script you did at the end to see if I understood everything but it didn't work, it give me this error
Workspace.Part.Script:3: attempt to index function with 'Parent'
and this is the script i did, could someone tell me what I did wrong?
local part = script.Parent
local function hit()
if hit.Parent:FindFirstChild("Humanoid") then
hit.Parent.Humanoid.Health = 0
end
end
part.Touched:Connect(hit)
you got the 2nd line wrong which triggered the 3rd line to be unknown. the right script is
local part = script.Parent
part.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
hit.Parent.Humanoid.Health = 0
end
end
Neil Samtani alright, thanks for the explanation
@@titouan496 No Problem.
Even after 6 months he’s still has a obsession with hotdogs and hamburgers
even if he misses smth its really close to the correct sricp. i got lost at the very end and olmost gave up but found out what to do by my self and it works now.
hi i learnt how to create and delete new objects from scripting with the help of the code examples from roblox
9:02 Don't mind me, just a timestamp for where I left off :D
good luck!
@@devRebirth thanks!
Good luck
how good are you at scripting now?
@@angrytoast3987 How about U?
something you can do is game.Workspace.Part.Anchored = false wait() game.Workspace.Part.Anchored = true so if you touch the part it unanchors but if you stop touching it it anchors.
I did not realize what hit was until I looked closely that the hit was in the function and the function was linked to Touched XD it's like a parameter or a argument
Lol i guess you never saw it the way he did
I got a 19minutes 50s ad on this video and watched all of it and I don't know why. And there as 2 ADS!
one thing i would have wanted is for him to explain what scenario this would be used in
Same, but different:
local Part = game.Workspace.Part
Part.Touched:Connect(function(hit)
if game.Players:GetPlayerFromCharacter(hit.Parent) then
hit.Parent.Humanoid.Health = 0
end
end)
now i know how to make a damage block script
The funny thing I learnt in this video is
Hit.Parent:Findfirstchild XDXDD
Bro I took over 30 minutes to understand how that killblock works but now I know
"hit.Parent:FindFirstChild"
ooookaaaayyyyy buddy
ok
just made a script that anchors your left lower leg and removes your head (r15 why not) from the things you taught me
script.Parent.Touched:Connect(function(hitTouch)
if hitTouch.Parent:FindFirstChild("LeftLowerLeg") then
hitTouch.Parent:FindFirstChild("LeftLowerLeg").Anchored = true
wait(1)
hitTouch.Parent:FindFirstChild("Head"):Destroy()
wait(1)
hitTouch.Parent:FindFirstChild("HumanoidRootPart").Anchored = true
end
end)
Do you have a discord or something that way its easier to ask questions and stuff
discord.gg/FKcSyRh I made one!
for anyone out there if the kill script isn't working (like me) just remove the findfirstchild part and it will work!
But then I wanna scale body part, so how do I make instead of health, it will be a body part, and get scaled.
TheDevKing: I oofed
Everyone else: you died
i love your tutorials
5:52
What if you want to slowly but continuously take health away
gamefan449 maybe you could add a while loop that takes health for every loop?
@@baconbitz3474 Just figured it out lol
local part = script.Parent
part.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
hit.Parent.Humanoid.Health = 0
end
end)
how did scripting go for u
one question what does part = script.parent do?
It's been a week so you probably figured it out. "Part" is a variable, in this case, meaning script.parent is simply saved into it. The script.parent finds the script, and then it's parent. E.g If a script were in a part called 'Duck' it would find the script, and then the parent is 'Duck'.
you should uploud this is really useful
Aaaaaaaa light theme
RIP eyes
i believe this man is using hotdog to infect his viewers with the word “hotdog”
or he was infected by the hotdog virus
@@eandts8556 he eats hotdogs