|
| 02 Jun 2013 12:36 AM |
Ok. Here is what I get: local WORD = DIRECTORY function WORD(MODEL) wait(NUMBER) Frame/Text/Model - Transparency/Visible/And Properties stuff VALUENAME.Value/Name Blahblah:remove/break joints/etc.() __________________________________________________________________ What I don't get: How many ends to I put in scripts Debounce script.Parent.Parent.BLAH WHAT DA HELL IS THAT etc.
HELP PLEASE!
~Missed me again :D |
|
|
| Report Abuse |
|
|
johnhugh
|
  |
| Joined: 26 Mar 2009 |
| Total Posts: 1971 |
|
|
| 02 Jun 2013 12:56 AM |
an end for every function an end for every for loop an end for every if...then statement *not an end for elseif...then or else statements (the end take cares of if and all of it's predecessors) Is this what you wanted? |
|
|
| Report Abuse |
|
|
|
| 02 Jun 2013 02:18 AM |
http://wiki.roblox.com/index.php/In-Depth_Scripting_Guide#The_.27end.27_Statement
~ ∂σи'т нαтє σи тнє ѕιggу ~ |
|
|
| Report Abuse |
|
|
|
| 02 Jun 2013 02:25 AM |
The script doesnt automatically know when you want to end a condition or specific function.
when you tell the script to make a function or an if statement (a condition), that's the first boundary.
function lol(arg) print(arg)
lol("hi")
the problem here is that there is no boundary that closes what you want to do when you call the function. so you add an "end" statement to close the function
function lol(arg) --start the function print(arg) --what the function does end --end the function
lol("hi") --running the function (or "calling" it) |
|
|
| Report Abuse |
|
|
|
| 02 Jun 2013 02:44 AM |
| Thanx guys! You guys are the best! But how about word script, like debounce or math etc? Do you put an END to it? |
|
|
| Report Abuse |
|
|
|
| 02 Jun 2013 02:47 AM |
you dont need an end statement after you define a variable
local variable = game.Workspace
now instead of typing game.Workspace you can type variable |
|
|
| Report Abuse |
|
|
|
| 02 Jun 2013 02:51 AM |
also, pertaining to how you cant understand script.Parent.Parent
script = the Current Script
script.Parent = Whatever the script's inside of.
script.Parent.Parent = Whatever the script's "Parent" (see previous) is inside of.
etc etc
so script.Parent.BLAH would look for something named BLAH in the script's "Parent"
script.Parent.Parent.BLAH would look for something named BLAH in the script's Parent's Parent
and the list goes on, hopefully you can see how this could be helpful |
|
|
| Report Abuse |
|
|
|
| 04 Jun 2013 06:33 PM |
@Alerifical Thank you! Just fixed my leaderboard. Might release it soon. Here is what I need: If the script is in the workspace, and I put parent, wouldn't that be in Game.Workspace? How do I make it to a different directory? Like script.Parent.Parent.MOREPARENTS.Humanoid AND the script is in workspace, how do I make it go to humanoid? Eg: Script directory/location: Game.Worspace.ScriptMain Wouldn't that be less than "GAME" parent? |
|
|
| Report Abuse |
|
|
| |
|
ToboboT
|
  |
| Joined: 25 Jun 2011 |
| Total Posts: 2385 |
|
|
| 05 Jun 2013 05:13 PM |
To change the parent of something. Assuming the script is in the part or thing you want to move or if you want to move the script.
To move the script's parent(Part or whatever the script is in):
script.Parent.Parent = game.CHANGETHIS
To move script:
script.Parent = game.CHANGETHIS |
|
|
| Report Abuse |
|
|
|
| 05 Jun 2013 05:15 PM |
| Thnx, but how many PARENTS is needed to get to player? |
|
|
| Report Abuse |
|
|
| |
|
ToboboT
|
  |
| Joined: 25 Jun 2011 |
| Total Posts: 2385 |
|
|
| 05 Jun 2013 05:26 PM |
To get to player? Do you want when it is touched or do want it to go straight to the player?
Put it in StarterPack and then it is script.Parent.Parent.Name That is the name of the player. You can set that as a variable and now you can find that in workspace with that.
When something is touched you would set up a function
function touch(h)
You just tagged the part touched with h
So now you would do this.
function touch(h) if h.Parent:findFirstChild("Humanoid") then Name = h.Parent.Name end end
That just said forever you touch this thing it will check if this tagged part "h" has a Humanoid in it's parent. And if it does then you are going to set the Variable "Name" of it. Now you can use that variable in this script.
To connect the function so that is works though is like this:
script.Parent.Touched:connect()
So all together if you want something to be touched and then find it's player's name then it should look like this:
function touch(h) if h.Parent:findFirstChild("Humanoid") then Name = h.Parent.Name end end
script.Parent.Touched:connect() |
|
|
| Report Abuse |
|
|