|
| 15 Jun 2013 05:59 PM |
I know the brick.Touched:connect (OnTouch) thing as a variable
Like
function OnTouch(Hit) brick.Transparency = 1 end
brick.Touched connect (OnTouch)
Would that script work? |
|
|
| Report Abuse |
|
|
Remynfv
|
  |
| Joined: 02 Dec 2011 |
| Total Posts: 587 |
|
|
| 15 Jun 2013 06:00 PM |
No.
You didn't define brick. |
|
|
| Report Abuse |
|
|
|
| 15 Jun 2013 06:01 PM |
@remyn
local.brick = Workspace.Brick
You mean that?
Or I forget what it was |
|
|
| Report Abuse |
|
|
|
| 15 Jun 2013 06:02 PM |
also, i know your new but
LUA = Learn Ur Acronyms Lua = a programing language used on roblox |
|
|
| Report Abuse |
|
|
Hergest
|
  |
| Joined: 17 May 2011 |
| Total Posts: 309 |
|
|
| 15 Jun 2013 06:02 PM |
function OnTouch(Hit) brick.Transparency = 1 end
brick.Touched connect (OnTouch)
Well, if brick is a variable. Also, you forgot the ':' mark between Touched and Connect. And Hit needs to be lowercase. I don't know if it's neccesary. So your script would be.
brick = game.Workspace.Part
function OnTouch(hit) brick.Transparency = 1 end
brick.Touched:connect(OnTouch)
I'm now a very exprienced scripter. But if you got questions or anything ask me!
|
|
|
| Report Abuse |
|
|
|
| 15 Jun 2013 06:04 PM |
So if I now know how to make a brick transparent when I touch it
Where should I go from there? |
|
|
| Report Abuse |
|
|
|
| 15 Jun 2013 06:04 PM |
| @hergest, hit doesnt have to be lower case, but all variables are case sensitive, so people naturally keep all of their variables lower case, to keep from miss typing them later on. |
|
|
| Report Abuse |
|
|
Hergest
|
  |
| Joined: 17 May 2011 |
| Total Posts: 309 |
|
|
| 15 Jun 2013 06:07 PM |
Well, the wiki is your source.
This is also a good method to learn.
Take a simple model, like a lava brick. Read the script until you understand it. If you don't understand it, you got the wiki and the forums! www.youtube.com/Pighead10 also makes some useful tutorials.
There's only 1 importmant thing i can say. Stay encouraged! You'll have some downsides about your script not working. But always keep trying!
Good luck! |
|
|
| Report Abuse |
|
|
|
| 15 Jun 2013 06:12 PM |
I actually understand this..
function OnTouch(hit) local humanoid = part.Parent:FindFirstChild("Humanoid") if (humanoid =~nil) then humanoid.Health = 0 end end
script.Parent.Touched:connect(OnTouch)
Would I need a variable for that? Like for the game to notice it? |
|
|
| Report Abuse |
|
|
|
| 15 Jun 2013 06:14 PM |
But hmm, when I put this onto a sphere block, it didn't seem to work.
function OnTouch(part) local humanoid = part.Parent:FindFirstChild("Humanoid") if (humanoid =~nil) then humanoid.Health = 0 end end
script.Parent.Touched:connect(OnTouch) |
|
|
| Report Abuse |
|
|
1WOOF1
|
  |
| Joined: 03 May 2009 |
| Total Posts: 20682 |
|
| |
|
|
| 15 Jun 2013 06:16 PM |
oh yeah i guess i forgot that part
@1woof1
do you remember me o_o |
|
|
| Report Abuse |
|
|
1WOOF1
|
  |
| Joined: 03 May 2009 |
| Total Posts: 20682 |
|
|
| 15 Jun 2013 06:17 PM |
@Wolf,
Not sure, I have a terrible memory... =( |
|
|
| Report Abuse |
|
|
Hergest
|
  |
| Joined: 17 May 2011 |
| Total Posts: 309 |
|
|
| 15 Jun 2013 06:20 PM |
In this line it defines the player.
local humanoid = part.Parent:FindFirstChild("Humanoid") Do you understand it? |
|
|
| Report Abuse |
|
|
1WOOF1
|
  |
| Joined: 03 May 2009 |
| Total Posts: 20682 |
|
|
| 15 Jun 2013 06:22 PM |
@Herg,
It defines the humanoid - Not the player.. Humanoid ~= Player |
|
|
| Report Abuse |
|
|
|
| 15 Jun 2013 06:23 PM |
@hergest
Yes, I understand that.
Just a question,
If I wanted a big sphere, like indiana jones style, to respawn on top of a hill, and keep respawning up there,
How would that script work? |
|
|
| Report Abuse |
|
|
Hergest
|
  |
| Joined: 17 May 2011 |
| Total Posts: 309 |
|
|
| 15 Jun 2013 06:29 PM |
| One moment, in a very busy moment. |
|
|
| Report Abuse |
|
|
|
| 15 Jun 2013 06:41 PM |
@jetta Lua is not a programming language. |
|
|
| Report Abuse |
|
|
|
| 15 Jun 2013 06:53 PM |
| correction: Lua is a programming language that falls within the subclass of what are known as "scripting languages." thus, it is indeed a programming language. |
|
|
| Report Abuse |
|
|
|
| 15 Jun 2013 06:56 PM |
@doom It is an interpreted language, so it's a scripting language. |
|
|
| Report Abuse |
|
|
Hergest
|
  |
| Joined: 17 May 2011 |
| Total Posts: 309 |
|
|
| 15 Jun 2013 07:05 PM |
-- If I wanted a big sphere, like indiana jones style, to respawn on top of a hill, and keep respawning up there,
Well, the script should keep spawning an object on its parent. Like a brick on top of the mountain. It should spawn a new instance in the shape of a sphere. You can change its properties by scripting it. (canCollide, et cetera.). You can also insert a kill script in it. I'm not really exprienced but i think you are capable of doing that with the help of models and the wiki. |
|
|
| Report Abuse |
|
|
|
| 15 Jun 2013 07:08 PM |
| a programming language is software we use to manipulate computers through the use of abstractions that humans can understand. it's a human-computer interface. interpreted or not, does Lua not satisfy this definition? |
|
|
| Report Abuse |
|
|
|
| 15 Jun 2013 07:09 PM |
| Yes, but Lua is a scripting language, regardless of its superclass. |
|
|
| Report Abuse |
|
|
| |
|
|
| 15 Jun 2013 07:11 PM |
| .. yes, Lua is a scripting language. i was correcting your earlier statement about Lua not being a programming language. |
|
|
| Report Abuse |
|
|