#buttons are invisible

1 messages · Page 1 of 1 (latest)

open bramble
#

ive been making a card game and the buttons dont want to show up they stay invisible and its printing the card art with the id but nothing shows up in the id property?? here is my code: theres other scripts as well which might be interfering:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local CardArtDB = require(ReplicatedStorage:WaitForChild("CardArtDB"))
local player = game.Players.LocalPlayer
local gui = player:WaitForChild("PlayerGui"):WaitForChild("DecklockUI")

local cardFrames = {
    gui:WaitForChild("Card1"),
    gui:WaitForChild("Card2"),
    gui:WaitForChild("Card3")
}

local function updateHand()
    local hand = player:WaitForChild("Hand")

    local cards = {}
    for _, card in ipairs(hand:GetChildren()) do
        table.insert(cards, card)
    end

    table.sort(cards, function(a, b)
        return a.Name < b.Name
    end)

    for i = 1, 3 do
        local frame = cardFrames[i]
        local card = cards[i]

        if card then
            local art = CardArtDB[card.Value]
            print("Art for card:", art) 
            if art then
                frame.Image = art
                frame.Visible = true
                frame.ImageTransparency = 0
            else
                frame.Visible = false
            end
        else
            frame.Visible = false
        end
    end
end

player:WaitForChild("Hand").ChildAdded:Connect(updateHand)
player:WaitForChild("Hand").ChildRemoved:Connect(updateHand)

wait(1) 
updateHand()
woeful furnace
#

You must do it in this format: rbxassetid://number

open bramble
#

yeah i did

#
local CardArtDB = {
    ["AceOfSpades"] = "rbxassetid://97778548798700",
    ["AceOfClubs"] = "rbxassetid://81108812169701",
    ["AceOfDiamonds"] = "rbxassetid://124156193000798",
    ["AceOfHearts"] = "rbxassetid://73505841096432",
    ["Goober"] = "rbxassetid://82541169757006",
    ["CupidArrow"] = "rbxassetid://93097815341606",
    ["EvilPuppet"] = "rbxassetid://103522889933980",
    ["BrokenGlasses"] = "rbxassetid://126363959284096",
    ["Gruel"] = "rbxassetid://116103181143105",
    ["BearTrap"] = "rbxassetid://120831507807301",
    ["RiggedDice"] = "rbxassetid://73505841096432"
}
return CardArtDB
open bramble
woeful furnace
# open bramble it should be correct

Why are you setting frame.Visible to false when art is not available?

if card then
   local art = CardArtDB[card.Value]
   print("Art for card:", art) 
   if art then
       frame.Image = art
       frame.Visible = true
       frame.ImageTransparency = 0
   else
       frame.Visible = false --< Try removing this line and see what happens
   end
else
   frame.Visible = false
end
#

Since the ID is not being set, I guess that is why it doesn't appear either?

open bramble
#

so if art is not available it doesnt put the ugly placeholder?

woeful furnace
#

But ID should be set since you are following the format..

woeful furnace
woeful furnace
#

@open bramble, maybe the fault is at card.Value?

open bramble
#

i doubt it

#

everything in value and card art db should be correct

woeful furnace
#

Have you verified there are no typos?

#

Me when I can't fix a stupid S1 bug:

open bramble
#

ive been on this for a week and im one click away from deleting the whole thing

woeful furnace
patent crescent
#

what does printing art give you

#

are you sure it is the ID

open bramble
#

exactly what itb should

patent crescent
#

can i see the print message?

open bramble
#

art for: id

#

sure wait let me test again

open bramble
open bramble
patent crescent
#

that is correct

#

it could possibly be indexing an incorrect frame

#

does image transparency get set to 0

open bramble
#

i am only s1 btw

#

here are the properties of the card in playergui

patent crescent
#

i dont see the problem?

#

it seems like it is being set?

open bramble
#

me neither

patent crescent
#

so what doesn't work correctly

open bramble
open bramble
#

BUT i can click them

#

and they do what theyre supposed to do

patent crescent
#

ok

#

so the ID is being set correctly

#

and it is visible

#

yet it just

#

doesn't show?

open bramble
#

outside of test

patent crescent
#

could you try setting background transparency of the card to 0 in the script here alongside these

#

frame.BackgroundTransparency = 0

open bramble
#

alright

patent crescent
#

i wanna see if it changes anything ingame

#

the expected result is that you get a blank background

open bramble
#

isnt it already 0?

patent crescent
#

its 1

#

meaning transparent

open bramble
patent crescent
#

set it to 0 with script just so we can test

open bramble
#

oh nvm

#

yeah i looked at image transparency

#

works

patent crescent
#

hmm

#

is this in starter gui or your player gui

open bramble
patent crescent
#

ok the problem has to be with the images themselves then

#

they fail to get set ingame

open bramble
#

can i remove the frame.BackgroundTransparency = 0?

#

wait actually nvm

#

its better this way so we can see

patent crescent
#

changes nothing

open bramble
patent crescent
#

the image is not transparent we know that

#

can you set the image manually

#

ingame

open bramble
#

outside of test?

#

alright

patent crescent
#

in test

open bramble
#

so you want me to remove the id already on the card

#

and put it back?

#

in server or client

patent crescent
#

client

#

remove the id and repaste it

#

yes

open bramble
#

in player or starter

patent crescent
#

not starter

#

your current one

open bramble
#

alright

#

i put a different id than the one it was supposed to use

#

and it works

patent crescent
#

and what about the one it is supposed to use

#

what if you put that yourself

#

does it work

open bramble
patent crescent
#

could you check the id now?

#

see what it actually is

open bramble
patent crescent
#

roblox could possibly be converting it into something else

patent crescent
open bramble
#

and it doesn't work

#

wait let me try again

open bramble
patent crescent
#

it would seem so

open bramble
#

so should i take every current id in cadartdb

#

put into the image property

#

convert it

#

and put it back into the script?

patent crescent
#

try

open bramble
#

alrighty

#

we could do this in a vc if you want

patent crescent
#

no need

open bramble
#

it would be much easier

patent crescent
#

i dont like vc

open bramble
#

alright

patent crescent
#

ping me here when you're done

open bramble
#

wait thats weird

#

i inserted rbxassetid://97778548798700 and it doesnt show up

#

@patent crescent

patent crescent
#

so its an incorrect id then?

open bramble
#

probably

#

let me try just inseting the number?

#

just the number works

#

but not the full rbxassetid://97778548798700

patent crescent
#

is the number converted to anything

open bramble
#

yes

#

ill insert it into the module script

#

@patent crescent done

#
local CardArtDB = {
    ["AceOfSpades"] = "http://www.roblox.com/asset/?id=74909498082581",
    ["AceOfClubs"] = "http://www.roblox.com/asset/?id=132846715336172",
    ["AceOfDiamonds"] = "http://www.roblox.com/asset/?id=82487202395996",
    ["AceOfHearts"] = "http://www.roblox.com/asset/?id=75659489598713",
    ["Goober"] = "http://www.roblox.com/asset/?id=139326789375493",
    ["CupidArrow"] = "http://www.roblox.com/asset/?id=75416192526490",
    ["EvilPuppet"] = "http://www.roblox.com/asset/?id=86072578396802",
    ["BrokenGlasses"] = "http://www.roblox.com/asset/?id=109866084416204",
    ["Gruel"] = "http://www.roblox.com/asset/?id=114225909176127",
    ["BearTrap"] = "http://www.roblox.com/asset/?id=125396143861487",
    ["RiggedDice"] = "http://www.roblox.com/asset/?id=134955816127270"
}
return CardArtDB
#

should i run it?

patent crescent
#

yes

open bramble
patent crescent
#

that's great

open bramble
#

thank you so much 🙏

patent crescent
#

so the numbers were incorrect

#

for some reason

open bramble
#

my hypothesis is that rbxassetid:// doesnt work anymore

open bramble
patent crescent
#

the numbers are different from the initial module

open bramble
patent crescent
#

i dont think so

#

but you can try

open bramble
#

idk man but im just happy it works