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: Will This Brick onTouch Script Work?!

Previous Thread :: Next Thread 
stealthsniper200 is not online. stealthsniper200
Joined: 03 Jul 2010
Total Posts: 981
24 Dec 2011 02:19 PM
function onTouch(Flame)
local Flame = game.Workspace:FindFirstChild("Flame")
if (game.Workspace.Power.Green.Sparkles = true) then
Flame.Fire = true
end
end

script.Parent.Touched:connect(onTouch)
-----------------------------------------------------------------------------------------

What I'm trying to do is take a barrel(Flame) and make the Fire (Fire) inside become true if it's touching the part containing the script in a model(Power).

It wont turn on unless the sparks (Sparkles) inside of the model in another part (Green) is true.

Basicly it's just starting a fire with sparks... :)
I ned help really bad withthis script, it's for Penumbra... :(
Report Abuse
ArceustheMaster is not online. ArceustheMaster
Joined: 17 Dec 2010
Total Posts: 17
24 Dec 2011 02:23 PM
well, it depends, if someone touches it do you want them die, or just as a decoration.
Report Abuse
stealthsniper200 is not online. stealthsniper200
Joined: 03 Jul 2010
Total Posts: 981
24 Dec 2011 02:26 PM
You don't touch anything, you activate the sparks with a button, and the sparks turn off after a few seconds so thats why I'm doing this.

Its kind o a puzzle...

Anyway's Idon't know how to make a script work if a brick is touching another brick...
Report Abuse
stealthsniper200 is not online. stealthsniper200
Joined: 03 Jul 2010
Total Posts: 981
24 Dec 2011 02:41 PM
Please help me! This script has been a problem for atleast a month, I'm sick of it...
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
24 Dec 2011 02:43 PM
Lol the reason why it's not working cause the function is not connected and it only runs once.


~= Pointless siggy. Ujelly? =~
Report Abuse
stealthsniper200 is not online. stealthsniper200
Joined: 03 Jul 2010
Total Posts: 981
24 Dec 2011 02:45 PM
So what add "while true do"? I didn't quite get what you were saying...
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
24 Dec 2011 02:59 PM
function onTouched(hit)

end

Also when do you want it to see if spark is true?

script.Parent.Touched:connect(onTouched)

~= Pointless siggy. Ujelly? =~
Report Abuse
stealthsniper200 is not online. stealthsniper200
Joined: 03 Jul 2010
Total Posts: 981
24 Dec 2011 03:04 PM
After you clicked the button in another model, which turns sparks on.
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
24 Dec 2011 03:06 PM
http://wiki.roblox.com/index.php/Making_an_onClicked_script

~= Pointless siggy. Ujelly? =~
Report Abuse
stealthsniper200 is not online. stealthsniper200
Joined: 03 Jul 2010
Total Posts: 981
24 Dec 2011 03:11 PM
So what? Use method 1? That doesn't exactly help much...
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
24 Dec 2011 03:12 PM
function onClicked()
    --Do stuff
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)


Make sure this script is inside of a click detector.


~= Pointless siggy. Ujelly? =~
Report Abuse
stealthsniper200 is not online. stealthsniper200
Joined: 03 Jul 2010
Total Posts: 981
24 Dec 2011 03:26 PM
Hey buddy, I already know hat script, it's one of the first things I learned. I don't need to know what thank you.

...Do you even understand most of the script?!

Well I'm going to try another method I guess...

function onHit(hit)
if game.Workspace:FindFirstChild("Flame") ~= nil then
game.Workspace.Flame:remove()

Or something... also yes, I do know the last line, I just don't wanna type it in the forums since it's in the script already...
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
24 Dec 2011 03:45 PM
YOur missing a end and a connect line.


~= Pointless siggy. Ujelly? =~
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