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

Why image won't appear?

Asked by 9 years ago

Hello everyone, I have problem with script, when Value reaches the designated number, then script should change image, but don't work...

Here is script:

a = script.Parent.Parent.doge
shibe = script.Parent.Parent.shibe
tang1 = script.Parent.Parent.tang1
tang2 = script.Parent.Parent.tang2
tang3 = script.Parent.Parent.tang3
script.Parent.MouseButton1Up:connect(function()
a.Value = a.Value + 1

if a.Value >= 20 and a.Value <= 40 then
    shibe.ImageTransparency = 1
    tang1.ImageTransparency = 0
elseif shibe.ImageTrasparency == 0 then
    tang1.ImageTransparency = 1
elseif a.Value >= 41 and a.Value <= 60 then
    tang1.ImageTransparency = 1
    tang2.ImageTransparency = 0
elseif tang1.ImageTransparency == 0 then
    tang2.ImageTransparency = 1
end

end)

1 answer

Log in to vote
0
Answered by 9 years ago
local a = script.Parent.Parent.doge
local shibe = script.Parent.Parent.shibe
local tang1 = script.Parent.Parent.tang1
local tang2 = script.Parent.Parent.tang2
local tang3 = script.Parent.Parent.tang3

script.Parent.MouseButton1Up:connect(function()
    a.Value = a.Value + 1

    if a.Value > 20 and a.Value < 40 then
        shibe.ImageTransparency = 1
        tang1.ImageTransparency = 0
    elseif shibe.ImageTrasparency == 0 then
        tang1.ImageTransparency = 1

    if a.Value > 41 and a.Value < 60 then
        tang1.ImageTransparency = 1
        tang2.ImageTransparency = 0
    elseif tang1.ImageTransparency == 0 then
        tang2.ImageTransparency = 1
end

end)

Try this.

0
I had same idea, but don't work. DevKarolus1 70 — 9y
Ad

Answer this question