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

ClickDetector Decal Changer, coding failure, why?

Asked by
BryanFehr 133
5 years ago

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)
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? LennyPlayzYT 269 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago
  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.
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. BryanFehr 133 — 5y
0
So you are telling me you are gonna make a different clickdetector or what? SoftlockedUnderZero 668 — 5y
Ad

Answer this question