|
| 30 Jul 2014 02:35 PM |
| Is there a script in which I can click a button and it'll change the decal on another brick? |
|
|
| Report Abuse |
|
|
|
| 30 Jul 2014 02:38 PM |
function onClicked() wait() game.Workspace.PartName.Decal.Texture = "" end script.Parent.ClickDetector.MouseClick:connect(onClicked) |
|
|
| Report Abuse |
|
|
|
| 30 Jul 2014 02:42 PM |
| Thanks, I'll try it out when I can access Studio. |
|
|
| Report Abuse |
|
|
|
| 30 Jul 2014 02:44 PM |
| Also don't forget to get a decals texture to subtract one from its ID. |
|
|
| Report Abuse |
|
|
fret13103
|
  |
| Joined: 15 Mar 2010 |
| Total Posts: 881 |
|
|
| 30 Jul 2014 02:44 PM |
Or group the button and the part with the decal, so that you can copy paste it.
function onClicked() wait() script.Parent.Parent.PartName.Decal.Texture = "" end script.Parent.ClickDetector.MouseClick:connect(onClicked) |
|
|
| Report Abuse |
|
|
|
| 30 Jul 2014 02:47 PM |
| So I've got to group the decal brick and the button together along with using the Decal Images to have it run properly? |
|
|
| Report Abuse |
|
|
|
| 30 Jul 2014 02:47 PM |
| No I guess hes just trying to make it easier. |
|
|
| Report Abuse |
|
|
fret13103
|
  |
| Joined: 15 Mar 2010 |
| Total Posts: 881 |
|
|
| 30 Jul 2014 02:52 PM |
| Yh, I'm just making it easier, so now you can spam the model, for example you can have a house with 2 of the "tv's" that change decal now. :) |
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 30 Jul 2014 02:59 PM |
local textures = { 33140055; 137580687; 62923964; }
local texture = 1 script.Parent.ClickDetector.MouseClick:connect(function() script.Parent.Decal.Texture = "http://roblox.com/asset/?id=" .. tostring(textures[texture]) texture = (texture ~= #textures and texture + 1 or 1) end)
|
|
|
| Report Abuse |
|
|
|
| 30 Jul 2014 03:25 PM |
| That'll actually help. I'm using ir for Lockdown Doors and I'm gonna have a few, so being able to have more in the same Workspace would be good, |
|
|
| Report Abuse |
|
|
|
| 30 Jul 2014 03:27 PM |
| 128, it looks like your script is able to flip through 3 decals instead of one. That might come in handy actually. |
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 30 Jul 2014 03:40 PM |
| It'll actually flip through as many as you add to the list lol |
|
|
| Report Abuse |
|
|
|
| 30 Jul 2014 03:42 PM |
| That's pretty neat. Also, how do I loop it so that the decal can change back and forth? |
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
| |
|
|
| 30 Jul 2014 04:00 PM |
| When I click the button with the single decal script, it works but I can't change it back to the other decal if I click it again. |
|
|
| Report Abuse |
|
|
|
| 30 Jul 2014 04:06 PM |
| Also, is there a way I can hook it up to two bricks? That way I only need one button to change the decal on two separate bricks. |
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 30 Jul 2014 04:26 PM |
First question; I still don't understand what you mean
Second; Yes but Im on my phone right now, Im sure someone else can make it for you |
|
|
| Report Abuse |
|
|
|
| 30 Jul 2014 05:29 PM |
| When I click the button, it changes the decal on the brick like it should. When I click the button again it does not change the decal back and is stuck on the decal that it changed to when I clicked the button. |
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 30 Jul 2014 10:09 PM |
Right now it'll pick decal1 decal2 decal3 decal1 decal2 decal3 repeat |
|
|
| Report Abuse |
|
|
smiley599
|
  |
| Joined: 23 Jan 2010 |
| Total Posts: 21869 |
|
|
| 30 Jul 2014 10:17 PM |
128GB he means like:
Starts at decal 1 Click! Becomes decal 2 Click! Back to decal 1 etc |
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 30 Jul 2014 10:30 PM |
Then only add 2 decals?
It'll go decal1 decal2 decal1 decal2 |
|
|
| Report Abuse |
|
|
|
| 31 Jul 2014 09:59 AM |
| So would I copy the line of the script with a new decal ID? How would I make it a loop though so I can click it any amount of times and it'll always change back and forth without stopping? |
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
| |
|
|
| 31 Jul 2014 04:53 PM |
Well I've decided to start of with this script:
function onClicked() wait() script.Parent.Parent.PartName.Decal.Texture = "" end script.Parent.ClickDetector.MouseClick:connect(onClicked
It only works once. |
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 31 Jul 2014 05:43 PM |
| Mine works, I tried it before I posted it. |
|
|
| Report Abuse |
|
|