Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I make a changing decal on click?

Asked by 6 years ago
Edited 6 years ago

How can I make a changing decal on mouse click?

Where would I put the script? ( in the part, workspace, server script service? )

Local Script or Regular Script?

I tried this to see if I could make it wait 30 seconds but it didn't work.

01  01  function click()
02  02  while true do
03  03  Decal1.Texture.Decal.Texture="rbxassetid://1568188388"--Copy this line and the one below it for more pictures
04  04  wait(5)
05  05  script.Parent.Decal.Texture = "rbxassetid://1571532370"--Edit for your textures asset Id.
06  06  wait(5)
07  07  script.Parent.Decal.Texture = "rbxassetid://1571532122"
08  08  end
09  09  end
10  10  script.Parent.ClickDetector.MouseClick:connect(click)
0
I fixed that but it's still not working Innovation_dev 2 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

Ok so here's what you need to do.

First, create 3 decals instead of one inside the part. (For example)

Name them each D1, D2, D3.

Set each of the image id's in the decals's texture

Set the D2 and D3's transparency to 1.

Right click the part in Explorer > Insert Object > Click Detector.

Then do the same thing for the server script, (aka Script) and insert that too with this code:

TL;DR: Create three Decals, name them each D1, D2, D3. Set the D2 and D3's transparency to 1. Set the image id's into the texture value. Insert click detector, and insert normal script with this code.

script.Parent.D1.Transparency = 0
function click()
while true do
script.Parent.D1.Transparency = 0
script.Parent.D3.Transparency = 1
wait(30)
script.Parent.D2.Transparency = 0
script.Parent.D1.Transparency = 1
wait(30)
script.Parent.D3.Transparency = 0
script.Parent.D2.Transparency = 1
wait(30)
end
end
script.Parent.ClickDetector.MouseClick:connect(click)

Hopefully this code works for you! It should because I tested it. PS: Please tell me if there is any other easier way if possible. EDIT: Made minor mistakes but they should be fixed.

0
I put it in exactly as you said and it's just staying on decal 3 :P Innovation_dev 2 — 6y
0
Turns out i missed a step but when I click the part it doesn't change to the other decal Innovation_dev 2 — 6y
0
Hmm... That's funny because it worked for me... Maybe it's because it's set for 30 seconds instead of one? iiGamer_Master 1 — 6y
Ad

Answer this question