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
 

How would I do this??

Previous Thread :: Next Thread 
yomamadude6 is not online. yomamadude6
Joined: 21 Nov 2009
Total Posts: 2151
02 Dec 2012 09:03 PM
Say I have this:

Workspace
+Control
++Script
+Model1
++Brick
++Script
+Model2
++Brick
++Script

The scripts in the Model allow me to change its color to a random color when I touch it. Now, I have a script in another brick called "Control" which lets me switch the two Brick's Parents to the other Brick's. But after I do this, the script in Model1 will control the brick in Model2 and vice versa. How would I make it so that the script controls the brick inside the Model even after I switch it?
Report Abuse
iBrilliance is not online. iBrilliance
Joined: 19 Oct 2012
Total Posts: 1032
02 Dec 2012 09:08 PM
Edit the script, and put it in the brick?

Alternately, you could copy and clone the script in the other model.
Report Abuse
yomamadude6 is not online. yomamadude6
Joined: 21 Nov 2009
Total Posts: 2151
02 Dec 2012 09:10 PM
Would I have to clone the script and destroy the original everytime I switch them? Is there an easier way?
Report Abuse
iBrilliance is not online. iBrilliance
Joined: 19 Oct 2012
Total Posts: 1032
02 Dec 2012 09:13 PM
Post your control script.
Report Abuse
blueboy167thst is not online. blueboy167thst
Joined: 24 Nov 2012
Total Posts: 106
02 Dec 2012 09:14 PM
Just do:
script.Parent.Brick

I like pineapples.
Report Abuse
yomamadude6 is not online. yomamadude6
Joined: 21 Nov 2009
Total Posts: 2151
02 Dec 2012 09:15 PM
Different example, but this is the connection line.


sp.Item.MouseButton2Click:connect(function() onRightClick(sp.Item) end)
sp.Item.DragBegin:connect(function() onBeginDrag(sp.Item) end)
sp.Item.DragStopped:connect(function(cx,cy) onStopDrag(cx,cy,sp.Item) end)
Report Abuse
yomamadude6 is not online. yomamadude6
Joined: 21 Nov 2009
Total Posts: 2151
02 Dec 2012 09:16 PM
@blueboy

Doesn't work. When used in a connection line, it will follow the brick.
Report Abuse
iBrilliance is not online. iBrilliance
Joined: 19 Oct 2012
Total Posts: 1032
02 Dec 2012 09:16 PM


game.Workspace.Model1.Script.Parent = game.Workspace.Model2
game.Workspace.Model2.Script.Parent = game.Workspace.Model1
Report Abuse
yomamadude6 is not online. yomamadude6
Joined: 21 Nov 2009
Total Posts: 2151
02 Dec 2012 09:17 PM
Oh sorry, the control script:


lookslot=ifitem.Parent

ifitem.Parent=ditem.Parent
ditem.Parent=lookslot
Report Abuse
yomamadude6 is not online. yomamadude6
Joined: 21 Nov 2009
Total Posts: 2151
02 Dec 2012 09:18 PM
@ibrillance

I don't think you understand my problem here, I can get it to switch perfectly. However, after they switch, the script in the Model will still target the brick that was originally in the Model before the switch. I want it to target the current brick instead.
Report Abuse
yomamadude6 is not online. yomamadude6
Joined: 21 Nov 2009
Total Posts: 2151
02 Dec 2012 09:24 PM
bump
Report Abuse
yomamadude6 is not online. yomamadude6
Joined: 21 Nov 2009
Total Posts: 2151
02 Dec 2012 09:43 PM
bummp
Report Abuse
yomamadude6 is not online. yomamadude6
Joined: 21 Nov 2009
Total Posts: 2151
02 Dec 2012 09:49 PM
bump
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