generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: I'm not sure how to approach LUA.

Previous Thread :: Next Thread 
Wolfbain2315 is not online. Wolfbain2315
Joined: 16 Aug 2011
Total Posts: 47619
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 is not online. Remynfv
Joined: 02 Dec 2011
Total Posts: 587
15 Jun 2013 06:00 PM
No.


You didn't define brick.
Report Abuse
Wolfbain2315 is not online. Wolfbain2315
Joined: 16 Aug 2011
Total Posts: 47619
15 Jun 2013 06:01 PM
@remyn

local.brick = Workspace.Brick


You mean that?

Or I forget what it was
Report Abuse
Jetta765214 is not online. Jetta765214
Joined: 22 Oct 2008
Total Posts: 1855
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 is not online. 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
Wolfbain2315 is not online. Wolfbain2315
Joined: 16 Aug 2011
Total Posts: 47619
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
Jetta765214 is not online. Jetta765214
Joined: 22 Oct 2008
Total Posts: 1855
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 is not online. 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
Wolfbain2315 is not online. Wolfbain2315
Joined: 16 Aug 2011
Total Posts: 47619
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
Wolfbain2315 is not online. Wolfbain2315
Joined: 16 Aug 2011
Total Posts: 47619
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 is not online. 1WOOF1
Joined: 03 May 2009
Total Posts: 20682
15 Jun 2013 06:15 PM
@Wolf,

~= not =~
Report Abuse
Wolfbain2315 is not online. Wolfbain2315
Joined: 16 Aug 2011
Total Posts: 47619
15 Jun 2013 06:16 PM
oh yeah i guess i forgot that part

@1woof1

do you remember me o_o
Report Abuse
1WOOF1 is not online. 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 is not online. 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 is not online. 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
Wolfbain2315 is not online. Wolfbain2315
Joined: 16 Aug 2011
Total Posts: 47619
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 is not online. Hergest
Joined: 17 May 2011
Total Posts: 309
15 Jun 2013 06:29 PM
One moment, in a very busy moment.
Report Abuse
thedestroyer115 is not online. thedestroyer115
Joined: 19 Dec 2010
Total Posts: 11546
15 Jun 2013 06:41 PM
@jetta
Lua is not a programming language.
Report Abuse
doombringer42 is not online. doombringer42
Joined: 13 Nov 2007
Total Posts: 5445
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
thedestroyer115 is not online. thedestroyer115
Joined: 19 Dec 2010
Total Posts: 11546
15 Jun 2013 06:56 PM
@doom
It is an interpreted language, so it's a scripting language.
Report Abuse
Hergest is not online. 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
doombringer42 is not online. doombringer42
Joined: 13 Nov 2007
Total Posts: 5445
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
thedestroyer115 is not online. thedestroyer115
Joined: 19 Dec 2010
Total Posts: 11546
15 Jun 2013 07:09 PM
Yes, but Lua is a scripting language, regardless of its superclass.
Report Abuse
HOTawesumKiD is not online. HOTawesumKiD
Joined: 10 Dec 2010
Total Posts: 120
15 Jun 2013 07:11 PM
crap info
Report Abuse
doombringer42 is not online. doombringer42
Joined: 13 Nov 2007
Total Posts: 5445
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image