Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

ClickDetector Decal Changer, coding failure, why?

Hello all! I placed this code inside the part which is being clicked in order to change a decal someplace else! It's not showing failure, why won't the decal change and the others be removed?

local tigers = script.Parent.Parent.Tigers
function click()
script.Parent.Parent.RBHL.Transparency = 1
wait (0.1)
script.Parent.Parent.Huskies.Transparency = 1
wait(0.1)
script.Parent.Parent.Sharks.Transparency = 1
wait (0.1)
script.Parent.Parent.Mustangs.Transparency = 1
wait (0.1)
script.Parent.Parent.Tigers.Transparency = 0
end
script.Parent.ClickDetector.MouseClick:Connect(click)

1 comment

0

First of all, why not you add the Ids into a table, then from there, after it get's selected as the decal id, why not you just remove it from the table?

1 answer

  1. Looks like all of the decals will be merged or something.
  2. Let's remember that if you click once (Assuming all decals are visible), all decals would disappear except the tiger decal. But once you click again, nothing changes. This is due to the fact you didn't change the transparency of the other decals, they stayed invisible the whole time and you forgot to change the decal's transparency.

2 comments

0

Right, I am aware of that. Which is why I would be creating different buttons for different decals. For example, there will be a decal of a tiger that, once clicked, shows the tiger logo. Same with all the other variables.

0

So you are telling me you are gonna make a different clickdetector or what?

This discussion is preserved as it was. New answers, comments, and votes are closed.