iQeeDEVS
(iQeeDEVS)
#1
I am trying to change ImageButton’s image url via script. But it won’t change from ServerScriptService…
There code:
local images = {
["elephant"] = "rbxassetid://16016416136"
}
local elephant = images[1]
local Players = game:GetService("Players")
game.Players.PlayerAdded:Connect(function(Player)
Player.PlayerGui:WaitForChild("QNA").AnswerGui.Frame.a1.Image = elephant
end)
Please someone help, thanks.
2 Likes
12345koip
(12345koip)
#2
Instead of images[1]
, try images["elephant"]
. Also, make sure that you have the asset ID correct.
iQeeDEVS
(iQeeDEVS)
#3
What… How it worked? I am so confused right now. Why images[“elephant”] worked instead of images[1]?
12345koip
(12345koip)
#4
It’s because you did
["elephant"] = --id
Instead of
[1] = --id
To use images[1]
you could do:
{
--id
}
Or
{
[1] = --id
}
1 Like
iQeeDEVS
(iQeeDEVS)
#5
Thank you my friend! I got it right now.
1 Like
system
(system)
Closed
#6
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.