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: Is this possible ? If yes, am I doing it right ?

Previous Thread :: Next Thread 
H3lIl0N0OplIllL1lI is not online. H3lIl0N0OplIllL1lI
Joined: 05 May 2014
Total Posts: 46
15 May 2014 01:06 AM
Is it possible to clone a script into whatever that touched it ?
Here's the script that I wrote..

LavaBomb = script.Parent

function onTouched(hit)
game.Lighting:findFirstChild(MeltScript):clone().Parent = hit
connection:disconnect()
end

connection = LavaBomb.Touched:connect(onTouched)
Report Abuse
JimmyChance is not online. JimmyChance
Joined: 01 Nov 2009
Total Posts: 3681
15 May 2014 01:13 AM
p=script.Parent

d=0
p.Touched:connect(function(hit)
local c=game.Lighting:FindFirstChild("MeltScript"):Clone()
if d==0 then d=1
c.Parent=hit
end
wait(1/2)
d=0
end)



Report Abuse
H3lIl0N0OplIllL1lI is not online. H3lIl0N0OplIllL1lI
Joined: 05 May 2014
Total Posts: 46
15 May 2014 01:16 AM
-BUMP-

--Recent Script Change--

LavaBomb = script.Parent

function onTouched(hit)
game.Lighting.MeltScript:clone().Parent = hit
connection:disconnect()
end

connection = LavaBomb.Touched:connect(onTouched)

--------------

This one works as intended, BUT it only works for the one part, I'm guessing it's because all the parts within the blast radius is now generally named ' hit ', so game is confused therefore it randomly picked one and clone the script inside that one :/

I want it to clone the MeltScript inside each and every part that touched this brick .
Report Abuse
H3lIl0N0OplIllL1lI is not online. H3lIl0N0OplIllL1lI
Joined: 05 May 2014
Total Posts: 46
15 May 2014 01:18 AM
@Jimmy I used your script and it works like the script I changed above, it only affects one brick
Report Abuse
H3lIl0N0OplIllL1lI is not online. H3lIl0N0OplIllL1lI
Joined: 05 May 2014
Total Posts: 46
15 May 2014 01:20 AM
A simpler explanation of how I want it to work,

------------------------

PartB is a 10,10,10 invisible sphere .

Everything that touches PartB will have a MeltScript cloned inside it .
So when I drive a car through PartB, all parts that touched it will have the script cloned inside them .

-----------------------

What's going on now,
Game only chose one part among the lot that touched PartB, and cloned the script particularly inside that one only .
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
15 May 2014 01:22 AM
'wait(1/2)'
why
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
15 May 2014 01:23 AM
Oh also the reason it only does it to one part is because you disconnect or, cancel, your touched event.
Report Abuse
H3lIl0N0OplIllL1lI is not online. H3lIl0N0OplIllL1lI
Joined: 05 May 2014
Total Posts: 46
15 May 2014 01:34 AM
OH NO WONDER XD

Forgot about the disconnect() xD

Thanks mate it works now :D
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