JasperK
|
  |
| Joined: 18 Jun 2012 |
| Total Posts: 55 |
|
|
| 25 Jun 2012 05:29 PM |
| Make it so, when a model is touched, by a certain brick, say a rocket projectile named BRICK, when the model is touched, it changes to a different model, aka, moves another model to workspace. |
|
|
| Report Abuse |
|
|
Bart8
|
  |
| Joined: 12 Jun 2008 |
| Total Posts: 1056 |
|
| |
|
| |
|
JasperK
|
  |
| Joined: 18 Jun 2012 |
| Total Posts: 55 |
|
| |
|
|
| 25 Jun 2012 05:53 PM |
I would use :clone Along with the onTouched function. |
|
|
| Report Abuse |
|
|
|
| 25 Jun 2012 05:56 PM |
| onTouched... That's all I have to say. |
|
|
| Report Abuse |
|
|
|
| 25 Jun 2012 07:39 PM |
I got no idea
~-ConceptDesign's Alt-~ |
|
|
| Report Abuse |
|
|
|
| 25 Jun 2012 07:44 PM |
| Guys, its .Touched not onTouched. And its an event, not a function. |
|
|
| Report Abuse |
|
|
|
| 26 Jun 2012 01:48 PM |
@The
You obviously don't know what you are talking about, functions can be named anything. And you need to use the function to make something happen in an event. |
|
|
| Report Abuse |
|
|
|
| 26 Jun 2012 02:38 PM |
@GreenDay
You would need an event as well as a function (well, I suppose it depends on how you write the code out).
brick = workspace.Rocket brick.Touched:connect(function(lol) brick:clone().Parent = -- Input where you want it to be cloned to. brick:Destroy() -- This essentially 'moves' the part. end) |
|
|
| Report Abuse |
|
|
|
| 26 Jun 2012 02:39 PM |
That's primarily one way of saying it.
~Leave me in the city with 50 bucks and watch me come back a millionaire~ |
|
|
| Report Abuse |
|
|
| |
|
Bart8
|
  |
| Joined: 12 Jun 2008 |
| Total Posts: 1056 |
|
|
| 26 Jun 2012 05:26 PM |
@Green Don't be such a TryHard bro.
k |
|
|
| Report Abuse |
|
|
|
| 26 Jun 2012 05:27 PM |
Why don't you stop posting useless information? We have no time for your idiotic posts here, even if it was a joke. He needs help, and all you did was annoyingly make his thread appear answered. Learn to get serious, or clear out.
~"If I win the lottery, the first thing I'm buying is an optical mouse"~ |
|
|
| Report Abuse |
|
|
jode6543
|
  |
| Joined: 16 Jun 2009 |
| Total Posts: 5363 |
|
|
| 26 Jun 2012 05:28 PM |
@Green No, he is right, and saying "a function can be named anything" only proves his point. It is a .Touched event, not an onTouched function. It doesn't matter what the function it connects to is named, it matters what the name of the event itself is named.
-Jode |
|
|
| Report Abuse |
|
|
|
| 26 Jun 2012 05:30 PM |
^
Lol, for a second I thought you meant Bart was right.
Anyway, I guess I was wrong qq
~"If I win the lottery, the first thing I'm buying is an optical mouse"~ |
|
|
| Report Abuse |
|
|
jode6543
|
  |
| Joined: 16 Jun 2009 |
| Total Posts: 5363 |
|
|
| 26 Jun 2012 05:30 PM |
On topic, you'll want to look into .Touched events, :Clone(), if statements, and functions.
-Jode |
|
|
| Report Abuse |
|
|
Bart8
|
  |
| Joined: 12 Jun 2008 |
| Total Posts: 1056 |
|
|
| 27 Jun 2012 05:40 PM |
I actually know more about scripting than you ever will. Considering I create websites and all you know is RBX.Lua.
k |
|
|
| Report Abuse |
|
|
zars15
|
  |
| Joined: 10 Nov 2008 |
| Total Posts: 9999 |
|
|
| 27 Jun 2012 05:42 PM |
| As model doesn't have touched event, i'd use region3, and then check if missile is within it. Only that would require to do loop, to check if there is rocket within it. |
|
|
| Report Abuse |
|
|
Cakins
|
  |
| Joined: 23 Jul 2009 |
| Total Posts: 307 |
|
|
| 27 Jun 2012 06:20 PM |
rocketreplacement = game.Lighting.mOdElNaMe
rocket = yourrocketmodel
-- Recursive function to find all of the 'Part's in the rocket rocket_parts = {}
function findparts(model) for a, b in pairs(model) do if b:IsA("Part") then table.insert(rocket_parts, b) end if #b:GetChildren() > 0 then findparts(b) end end end
parttouched = false
for a, b in pairs(rocket_parts) do b.Touched:connect(function(part) if parttouched == false then parttouched = true
newrocket = rocketreplacement:Clone() newrocket.Parent = workspace newrocket:MoveTo(part.Position) rocket:Destroy() end end) end |
|
|
| Report Abuse |
|
|
|
| 27 Jun 2012 06:23 PM |
If you really know that much, then you should start helping instead of trolling. This isn't a place for joking.
~"If I win the lottery, the first thing I'm buying is an optical mouse"~ |
|
|
| Report Abuse |
|
|
Cakins
|
  |
| Joined: 23 Jul 2009 |
| Total Posts: 307 |
|
|
| 27 Jun 2012 06:30 PM |
| First of all: at no time was I trolling. I offered by far the most helpful post, and still people are criticized. NO ONE is obligated to help you. People can post whatever they want on these forums. The only one with an obligation is YOU. You are obligated to at least have background knowledge, or know what you want to do. In the recommendations for these forums, you are told to provide us with a piece of code, along with the place where you believe it is not working properly, and if possible, an explanation of why. You provided us with NOTHING. Rather than play the roll of contractor, you need to play the role of person-looking-for-a-loan. Know what you want, without expecting anyone to help you, but be appreciative when they do. |
|
|
| Report Abuse |
|
|
WhiteRain
|
  |
| Joined: 24 Apr 2010 |
| Total Posts: 2723 |
|
|
| 27 Jun 2012 06:32 PM |
@Cak I think Green was speaking of Bart... |
|
|
| Report Abuse |
|
|
Cakins
|
  |
| Joined: 23 Jul 2009 |
| Total Posts: 307 |
|
|
| 27 Jun 2012 06:34 PM |
| But like I said, people are not obligated to help. And it actually HELPS the poster if Bart, or whoever, is spamming, as it bumps the post. |
|
|
| Report Abuse |
|
|
|
| 27 Jun 2012 06:35 PM |
| I think he was talking to Bart8. . . lol |
|
|
| Report Abuse |
|
|