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

Why image won't appear?

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

✓ Accepted answer
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.

1 comment

0

I had same idea, but don't work.

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