Wolfe7112
|
  |
| Joined: 24 Jul 2011 |
| Total Posts: 15891 |
|
|
| 20 Jul 2013 11:18 PM |
Come on
I only know this
game.Workspace.Wolfe7112['Left Leg']:Remove()
~Feeling lit, feeling right, 2 AM, Summer night~ Kid Cudi... Add me on xfire Wolfe7112 |
|
|
| Report Abuse |
|
|
|
| 20 Jul 2013 11:20 PM |
:D?
http://www.youtube.com/user/ThePighead10 |
|
|
| Report Abuse |
|
|
muscus32
|
  |
| Joined: 18 Oct 2012 |
| Total Posts: 2648 |
|
|
| 20 Jul 2013 11:21 PM |
Well I can give a easy one. here
game.Workspace.Player1.Humanoid.Health = 0
|
|
|
| Report Abuse |
|
|
Wolfe7112
|
  |
| Joined: 24 Jul 2011 |
| Total Posts: 15891 |
|
|
| 20 Jul 2013 11:23 PM |
I need a teacher
~Feeling lit, feeling right, 2 AM, Summer night~ Kid Cudi... Add me on xfire Wolfe7112 |
|
|
| Report Abuse |
|
|
|
| 20 Jul 2013 11:24 PM |
Watch the videos on this channel... You will learn a lot...
http://www.youtube.com/user/ThePighead10
|
|
|
| Report Abuse |
|
|
Wolfe7112
|
  |
| Joined: 24 Jul 2011 |
| Total Posts: 15891 |
|
|
| 20 Jul 2013 11:25 PM |
Teacher gets moeny
links get you nothing
~Feeling lit, feeling right, 2 AM, Summer night~ Kid Cudi... Add me on xfire Wolfe7112 |
|
|
| Report Abuse |
|
|
muscus32
|
  |
| Joined: 18 Oct 2012 |
| Total Posts: 2648 |
|
|
| 20 Jul 2013 11:26 PM |
| Yes, that is true but still links could help and it could be free. |
|
|
| Report Abuse |
|
|
|
| 20 Jul 2013 11:27 PM |
No a teacher gets me worthless virtual currency.
I don't want that.
I gave you a link to learn lots for free. Those videos was where I started. Everything I well explained. |
|
|
| Report Abuse |
|
|
Wolfe7112
|
  |
| Joined: 24 Jul 2011 |
| Total Posts: 15891 |
|
|
| 20 Jul 2013 11:28 PM |
can u script @notso if so teach me
~Feeling lit, feeling right, 2 AM, Summer night~ Kid Cudi... Add me on xfire Wolfe7112 |
|
|
| Report Abuse |
|
|
|
| 20 Jul 2013 11:29 PM |
| I suggest you try a youtube video or hit the wiki. It's better than paying 9k for a teacher and risking getting masced. |
|
|
| Report Abuse |
|
|
|
| 20 Jul 2013 11:31 PM |
Yes I can script. Very well according to me. I would rather not teach you.
But as I stated many times before. You can easily learn lots on youtube or lualearners.org/Lua.bz |
|
|
| Report Abuse |
|
|
|
| 20 Jul 2013 11:31 PM |
| Or how about join one of the 10+ free Lua teaching groups. |
|
|
| Report Abuse |
|
|
|
| 21 Jul 2013 12:13 AM |
I really hope this helps. Take time reading it, it actually does really help.
. means going onto the next thing like they're all a family
so game is a parent of Workspace
and workspace is the child of game and Workspace is the parent of anything thats in workspace
so if you wanna delete a brick, thats in workspace.
it would go, game.Workspace.Brick:remove()
also you can create variables.
so instead of typing it all out, you can just shorten in it, EX:
thisisacoolvariable = game.Workspace.Brick
so if you would want to change the properties really fast to make a color changer, a lot less typing EX:
thisisacoolvariable.BrickColor = BrickColor.new("Really red") wait(1) thisisacoolvariable.BrickColor = BrickColor.new("Really black")
so variables help a lot.
also if you want to create a hint EX:
h = Instance.new("Hint", game.Workspace") Here it basically tells the h is variable and that variable means an Instance which can be a ForceField, explosion, anything that is in Insert>Object
----------------------------------------------------------------------------------------
And hint is the name of the Instance. and when I say ("Hint", game.Workspace it means i'm inserting the into into workspace so it doesnt go off into lighting or something
------------------------------------------------------------------------------------------- Hint is like a black bar with text that goes ontop of your screen
you can change the text by this EX:
h.Text = ("Hi!")
Remember, h is a variable. And we're going into h and finding "Text" and changing the text to "HI"
wait is a function where it basically stops the whole script for a certain amount of time.
So like wait(1) this waits 1 second then continues with the rest of the script.
I hope this helped. I spent about 10 minutes writing this down. :D PM me if this helped, or you got anymore questions. |
|
|
| Report Abuse |
|
|
|
| 21 Jul 2013 12:43 AM |
Really what you said you know above is all you need to know.
Also, don't waste money on a teacher.
Periods: '.' are used to access the child of an object or its property. everything except the 'workspace' folder in the explorer has a 'parent' class. (Workspace's actual parent along with StarterGui, Lighting and so forth is 'game') to access this parent class you simply do
Object.Parent.
The only way you can learn anything is by actually trying to figure it out, not just absorbing information. Go to the explorer and click on a brick. Its name will probably be 'Part'. Open your properties (view > properties) and look around. Here you can see things like it's color, transparency, reflectancy, so forth. All these properties can be edited using periods.
You know how to do game.Workspace.Player["Right leg"]:Remove() so you can do anything else. Try to make someone's Right leg invisible,
Heres how: game.Workspace.Player["Right leg"].Transparency = 1 why does this work? Well, "game" is the entire game obviously, and Workspace is what contains everything we see and everything that does anything, so obviously your player will be inside Workspace.
Why don't we just do "Player.Right leg.Transparency = 1" then?
Well, the actual part for the leg is CALLED: "Right leg" (Im not sure the caps, but im close and you get the picture thats all that matters) You can't put spaces when you are telling the computer what you are looking for, because it thinks you are looking for something else. If I said:
Player.Right Leg.Transparency The computer will be confused and for instance, it will think "Ok I'm looking for something callled "Right" inside the player. Oh, now I'm looking for Transparency inside of "Leg"... That makes no sense..." (just for example)
the brackets and quotes let you search for things with spaces in their names.
Now theres this:
String = game.Player String.Head:Remove() String["Right leg"].Transparency = 1 String.Torso.BrickColor = BrickColor.new("Bright green") ---That will do the same thing as game.Workspace.Player.Head:Remove() game.Workspace.Player["Right leg"].Transparency = 1 game.Workspace.Player.Torso.BrickColor = BrickColor.new("Bright green")
why do they do the same thing, when one is less writing than another? You can set strings and integers to certain properties so you can come back and edit them whenever you want in a code. This helps you not have to write the same thing over and over and over.
-------------------------------------------------
I'm here to help, PM me any more questions, free of charge. (Anybody)
For my last trick, I shall write a simple lava script and explain it in full detail.
--------------------------------------------------
function onTouch(part) if part.Parent:findFirstChild("Humanoid") == true then part.Parent.Humanoid.Health = 0 end end script.Parent.Touched:connect(onTouch)
That will kill a player if they touch that brick. Why? Lets look.
function, what is that? A function is an event you can call whenever you want, and it wont run until you tell it to. If you just write a script without a function, it will run as soon as the game starts before your player even loads. Without functions you have no control over when to what you want.
the onTouch(part) is the part where you decide what to name your function, and the "(part)" is the operator by which the function operates. This is hard to explain by itself, so lets bring in that last line: "script.Parent.Touched:connect(onTouch)"
Remember how functions don't fire until you tell them to? Well that last line tells the function to fire when the Parent (lava brick) is touched by anything. "Touched" is a property event that is used to trigger the function via ":connect(onTouch)". Touched is like an invisible property all bricks have. It isn't listed in the properties list, but it is there. the :connect part can be used for more than just "Touched", I would bring up examples but they would only confuse you in this context. the (onTouch) is the name of the function made earlier, it tells the :connect which function to fire. The name of the function doesn't matter at all! You can call it BarneyTown and if you use it in both places it will work!
I hope that explained that well! Onward!
the "if part.Parent:findFirstChild("Humanoid") == true then" means, if the part.Parent (remember, if a leg, head, arm, or torso hits this brick, its Parent will be a player model, which will have a humanoid child) has a Humanoid in it, it continues the script, and if not, it cancels. The rest is quite obvious, Health = 0 kills the player.
I hope you understand more than you did when you first started, the rest is truly up to you to check the wiki and experiment in studio. You can pay a teacher all you want to spoon feed you, but I promise a teacher will never force you to comprehend the logic you need to know, and he can never teach you how to lua if you totally rely on him.
-------------------------------------------------------
Bonus:
another way you can write a lava script is shown as such. Figure it out
script.Parent.Touched:connect(function(hit) local h = hit.Parent:FindFirstChild("Humanoid") if h then h.Health = 0 end end)
Hint1: "if h then" and "if h == true then" are the same, as the default question is if == true Hint2: you can put multiple lines of code on one line |
|
|
| Report Abuse |
|
|
|
| 21 Jul 2013 12:47 AM |
What sidekick601 said is probably helpful in some areas, but no offense he mostly listed pieces of information, I atleast attempted to list a soup of information. My information can be added to and improved on to help you learn scripting, but sidekick's only is useful in the right situations.
Also a correction for above (me and everyone else)
DO NOT USE ":remove()"!!!
:Remove() adds items to the debris, or, replaces it's parent with nil.
for example
part.Parent = nil is the same as part:Remove()
this makes it possible to do this:
part:Remove() wait(3) part.Parent = game.Workspace
:Remove() doesn't destroy things, and that can make games laggy. Instead,
Use ":Destroy()"
part:Destroy()
that completely removes things. |
|
|
| Report Abuse |
|
|
|
| 21 Jul 2013 01:04 AM |
| What I listed was the basics. He doesn't need to move onto advanced scripts. He only knows one line. You're taking him too far. I'm guiding him the correct speed to fully work and function the coding lua. |
|
|
| Report Abuse |
|
|
|
| 21 Jul 2013 01:11 AM |
I wasn't teaching advanced things. I technically taught how to edit every property of everything, basic, and explained a basic script to him. You can't spoon feed lines of code without explaining and expect that to do much. He needs to understand what every single tiny character means, not what entire lines of basic codes mean.
Sorry if I offended you earlier, I was just stating facts. I taught him the exact way I learned Lua. Learning Lua is more like getting pushed off of a cliff in a hangglider. Your instructor can only push you a little, you have to make the leap and glide to knowledge. |
|
|
| Report Abuse |
|
|