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: How would I?

Previous Thread :: Next Thread 
JasperK is not online. 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 is not online. Bart8
Joined: 12 Jun 2008
Total Posts: 1056
25 Jun 2012 05:48 PM
idk gewgle et

k
Report Abuse
GreenDay987 is not online. GreenDay987
Joined: 21 May 2011
Total Posts: 7027
25 Jun 2012 05:49 PM
@Bart

Get out.
Report Abuse
JasperK is not online. JasperK
Joined: 18 Jun 2012
Total Posts: 55
25 Jun 2012 05:51 PM
Hm,
Report Abuse
GreenDay987 is not online. GreenDay987
Joined: 21 May 2011
Total Posts: 7027
25 Jun 2012 05:53 PM
I would use :clone
Along with the onTouched function.
Report Abuse
QuadBlader is not online. QuadBlader
Joined: 22 Jun 2012
Total Posts: 26
25 Jun 2012 05:56 PM
onTouched... That's all I have to say.
Report Abuse
rosenburger is not online. rosenburger
Joined: 03 Aug 2009
Total Posts: 8407
25 Jun 2012 07:39 PM
I got no idea

~-ConceptDesign's Alt-~
Report Abuse
TheAwesomenessDude is not online. TheAwesomenessDude
Joined: 17 Jul 2011
Total Posts: 11602
25 Jun 2012 07:44 PM
Guys, its .Touched not onTouched. And its an event, not a function.
Report Abuse
GreenDay987 is not online. GreenDay987
Joined: 21 May 2011
Total Posts: 7027
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
ggfunny1234 is not online. ggfunny1234
Joined: 09 Jul 2010
Total Posts: 3432
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
GreenDay987 is not online. GreenDay987
Joined: 21 May 2011
Total Posts: 7027
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
RockTheory is not online. RockTheory
Joined: 02 Jun 2012
Total Posts: 140
26 Jun 2012 02:40 PM
.
Report Abuse
Bart8 is not online. 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
GreenDay987 is not online. GreenDay987
Joined: 21 May 2011
Total Posts: 7027
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 is not online. 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
GreenDay987 is not online. GreenDay987
Joined: 21 May 2011
Total Posts: 7027
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 is not online. 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 is not online. 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 is not online. 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 is not online. 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
GreenDay987 is not online. GreenDay987
Joined: 21 May 2011
Total Posts: 7027
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 is not online. 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 is not online. 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 is not online. 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
DragonWarlord101 is not online. DragonWarlord101
Joined: 26 Oct 2008
Total Posts: 363
27 Jun 2012 06:35 PM
I think he was talking to Bart8. . . lol
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