You have to reuse the directory to do the logic (It’s a little hard to explain). Also you should just define it in a variable instead of reusing all that code. This is how it should look like for one of them. (I’m not going to do it for all of them)
local moneyValue = script.Parent.MoneyValue
if moneyValue.Value == 20 and moneyValue.Value < 49 then
end
Sigh… your other if-statements are still wrong. I have no clue what you’re trying to accomplish by doing
3<4 or 6<9 either, so I removed them from the code.
I can’t fix the formatting since I’m typing it on here, but please format it correctly for your own sake.
local moneyValue = script.Parent.MoneyValue
script.Parent.Equipped:Connect(function()
if moneyValue.Value == 1 then
script.Parent.Handle.Decal1.Texture = "http://www.roblox.com/asset/?id=7994761"
script.Parent.Handle.Decal.Texture = "http://www.roblox.com/asset/?id=7994777"
elseif moneyValue.Value == 2 then
script.Parent.Handle.Decal1.Texture = "http://www.roblox.com/asset/?id=12424991"
script.Parent.Handle.Decal.Texture = "http://www.roblox.com/asset/?id=12425000"
elseif moneyValue.Value == 5 then
script.Parent.Handle.Decal1.Texture = "http://www.roblox.com/asset/?id=7994783"
script.Parent.Handle.Decal.Texture = "http://www.roblox.com/asset/?id=7994786"
elseif moneyValue.Value >= 10 or moneyValue.Value <= 19 then
script.Parent.Handle.Decal1.Texture = "http://www.roblox.com/asset/?id=85365754"
script.Parent.Handle.Decal.Texture = "http://www.roblox.com/asset/?id=85366004"
elseif moneyValue.Value >= 20 and moneyValue.Value <= 49 then
script.Parent.Handle.Decal1.Texture = "http://www.roblox.com/asset/?id=85366394"
script.Parent.Handle.Decal.Texture = "http://www.roblox.com/asset/?id=85366498"
elseif moneyValue.Value >= 50 and moneyValue.Value <= 99 then
script.Parent.Handle.Decal1.Texture = "http://www.roblox.com/asset/?id=12424991"
script.Parent.Handle.Decal.Texture = "http://www.roblox.com/asset/?id=12425000"
elseif moneyValue.Value <= 100 then
script.Parent.Handle.Decal1.Texture = "http://www.roblox.com/asset/?id=12424991"
script.Parent.Handle.Decal.Texture = "http://www.roblox.com/asset/?id=12425000"
end
It’s because it looks at the first few if-statements and says: moneyValue is not 1, or 2, or 5 and it fits the value of being <=19 so that’s why it goes to 10. I didn’t realize you had so many logic problems.
To fix this you could just remove all the if-statements checking if it’s a specific value like 1, 3, 5 and just make it so if the value is < 10 then you would make it the same image as a 1. Or if you want it to be specific so only a 1 and a 3 get the texture of a 1 then it would be:
if moneyValue.Value == 1 or money.Value == 3 then
It is not clear on what functionality you are looking for. Modify it to what you want it to do.
It’s a little hard to tell on what functionality you want, so I’m just going to guess. It’s always going to make the 19 dollar bill a 100 because you put it to <= 100 which all numbers under 100 apply.
I can’t test this so I’m not really sure how this is going to work but this should make it so the image is now set to the closest one possible.
local moneyValue = script.Parent.MoneyValue
script.Parent.Equipped:Connect(function()
if moneyValue.Value == 1 then
script.Parent.Handle.Decal1.Texture = "http://www.roblox.com/asset/?id=7994761"
script.Parent.Handle.Decal.Texture = "http://www.roblox.com/asset/?id=7994777"
elseif moneyValue.Value < 4 and moneyValue.Value ~= 1 then
script.Parent.Handle.Decal1.Texture = "http://www.roblox.com/asset/?id=12424991"
script.Parent.Handle.Decal.Texture = "http://www.roblox.com/asset/?id=12425000"
elseif moneyValue.Value >= 4 and money.Value < 8 then
script.Parent.Handle.Decal1.Texture = "http://www.roblox.com/asset/?id=7994783"
script.Parent.Handle.Decal.Texture = "http://www.roblox.com/asset/?id=7994786"
elseif moneyValue.Value >= 8 and moneyValue.Value < 15 then
script.Parent.Handle.Decal1.Texture = "http://www.roblox.com/asset/?id=85365754"
script.Parent.Handle.Decal.Texture = "http://www.roblox.com/asset/?id=85366004"
elseif moneyValue.Value >= 15 and moneyValue.Value < 35 then
script.Parent.Handle.Decal1.Texture = "http://www.roblox.com/asset/?id=85366394"
script.Parent.Handle.Decal.Texture = "http://www.roblox.com/asset/?id=85366498"
elseif moneyValue.Value >= 35 and moneyValue.Value < 75 then
script.Parent.Handle.Decal1.Texture = "http://www.roblox.com/asset/?id=12424991"
script.Parent.Handle.Decal.Texture = "http://www.roblox.com/asset/?id=12425000"
elseif moneyValue.Value >= 100 then
script.Parent.Handle.Decal1.Texture = "http://www.roblox.com/asset/?id=12424991"
script.Parent.Handle.Decal.Texture = "http://www.roblox.com/asset/?id=12425000"
end