Roblox Beginners Scripting Tutorial 8 - Parameters

preview_player
Показать описание

Watch the video then keep practicing. Experiment to see what you can do with the script and all the techniques that you have learned so far.

Got any questions or suggestions for this video? Leave it in the comments.
Рекомендации по теме
Комментарии
Автор

8 years and your videos are helping me learn scripting!! Thx!!!

hoax
Автор

I'm learning a LOT from these videos. this guy is awesome.

thejumpyguitargamers
Автор

With the first few tutorials i'll be showing you how to print to the output using all different techniques. You will soon learn how to make things work in games rather than just printing to the output.

PeasFactory
Автор

Heres a helpful way to use parameters:


function greeting(name)
print("Hello"..name)
end)

greeting("Alex")



It will say "Hello Alex"

sobordinates
Автор

years later people are still watching that is how you know this is good
XD

bigbangu
Автор

Whenever I 'get' something in the videos, I always feel so excited inside and think "THAT'S SO COOL!!!!11!1!1!11!"

awesomerango
Автор

Every time i watch his videos and learn something new i just feel so happy i feel like i'm one step closer to achieving my dream

firstgamer
Автор

OMG I FINALLY UNDERSTAND WHY/ WHAT IT IS THAT GOES IN THE (). LISTEN UP- About 6 to 7 monthes ago, I wanted to learn to script so bad!! I would watch all the videos as quick as possible, and thinkin I knew everything, would try to make a simple game, but only become frustrated. I've learned after a two- three month break, to take things slow. DON"T RUSH ANYTHING. If you want to learn how to script/make a game. YOu need to put in the work, all the great devs were like you/me at one point. They most likely worked their asses off. Thats why for the past week, I have been getting up at four and practicing!! I am now not only takin things slow, but being realistic with my goals. I hope to be a good (not great, maybe just decent) by March of 2019. KEEP GOING.

aidenh
Автор

If you guys are having troubles, remember to keep files of previous scripts you've made for refrence and to go back if you forget or need to understand something more

wn
Автор

Yeah, pretty much but you can only use the parameter within that specific function.

PeasFactory
Автор

Alexander the Great is now playing Team Fortress 2

thedudeguy
Автор

Taking a python class really did help with learning this and I feel like it's helping me learn faster because I know a lot of this stuff. Thanks so much PeasFactory.

CheeseburgerStreaming
Автор

You have been quite ample help! You're in your 20's by now since this is about 4 - 5 years ago.. But thank you for all your efforts into putting your time to these videos, my friend told me about you so I was watching your videos and I got so hooked on this specific genre.

harryking
Автор

I know this is so old, but I used to give up on scripting when I needed these types of videos. I am learning way better than a wiki or any other video. Thank you so much dude.

cjperlotto
Автор

This is very late, and this is a great video, but I'd like to add:
A parameter is multipurpose, meaning I can use it for multiple situations that I can't with a non parameter function.


For example:


function hello()
print(5 - 2)
end


hello()




That is a script I can only use for one thing, which is making this function print 3.




function hello(var1, var2)
print(var1 - var2)
end


print(hello(5, 4))


print(hello(7, 2))


You can use any numbers because you have parameters.


Hopes this helps explain why developers choose to use parameters in the first place.

trezxx
Автор

I'm realizing how much programming relates to math.
It's exactly like a function in math.

Let's say we have a function f(x)=x+1

We have our function named(f), and x is our parameter.
When calling our function we assign a value to x.
For example, f(3)=3+1
We put in 3 for our parameter. We could've put anything in there.
F(10)=10+1
F(37392947)=37392947+1
F(greg)=greg+1

Our function names and parameters are ours to play with as well. You don't have to name your function f and you dont have to make your parameter x. You can make them whatever. I hope this helps people who can understand this math topic but are having trouble with this video, because that was me at one point.

mattmarafino
Автор

If you need any help, I've done a script and an explanation with all the things I've learned so far.



function add(var1, var2)
script.Parent.Transparency = var1 + var2
wait(2)
print("Yay")
wait(2)
print("So lets say you're a customer, you go into a store and pay 2 dollars for a drink, though you paid an extra dollar.")
return(1)
end

print(add(0.25, 0.25))

--[[ So what we're doing here is we're using a function, and adding variables. (Parameters.)
And the numbers that are those variables, are 0.25. Both of them. and so, we set up a part transparency script for the part.
We then add those two variables together to make 0.5 Transparency.
Then we wait 2 seconds.
Then we print 'Yay' and wait 2 seconds again.
And then we print a little story. "So lets say you're a customer, you go into a store and pay 2 dollars for a drink, though you paid an extra dollar.)"
Then we return the dollar. "Return(1)"
Then we end the function.
And the last part, because we returned 1, the function has now a value of 1. Thus making us have to print it to get the value. We set up the parameters (Var1, var2) and have them 0.25 each.
Thus making the Transparency 0.5, as I said before.
End of explanation.
--]]

kitsu
Автор

Can you only call functions that are in this script?

criminechen
Автор

You are honestly amazing! Even in 2020 :3

galacticquasaur
Автор

"Yo Wazzup :)>" I just wanted to share with you that although this content has aged a little now, the core value it outputs is > than most videos I've tried to learn from..

I've also learnt that it can take weeks just to understand a concept sometimes, and that it takes time to learn in the scripting world. Learning a new language is probably one of the hardest skills one can accomplish, Especially one that can change the tech we use today.

SkepticleOrc