so i am making a game and when i make it to change an image. it doesn’t change!
local script:
script.Parent.MouseButton1Click:Connect(function()
script.Parent.Parent.Visible = false
script.Parent.Parent.Parent.Elevator.Visible = true
script.Parent.Parent.Parent.Elevator:TweenSize(UDim2.new(1,0,1,0), Enum.EasingDirection.In, Enum.EasingStyle.Quad, 0.7)
wait(0.7)
script.Parent.Parent.Parent.Elevator.ElevatorDoor.Image = "9751412256"
wait(1)
script.Parent.Parent.Parent.Elevator.ElevatorDoor.Image = "9751413232"
wait(1)
script.Parent.Parent.Parent.Elevator.ElevatorDoor.Image = "9751414842"
wait(1)
script.Parent.Parent.Parent.Elevator.ElevatorDoor.Image = "9751415443"
end)
Setting the image via a script doesn’t automatically set it correctly for you…
You’ll need to add rbxassetid://
before the ID.
Motofied:
rbxassetid://
still doesn’t work for some reason.
Try using http://www.roblox.com/asset/?id=
as well.
Mind showing us the modified script?
V_ladzec
(Volter)
May 28, 2022, 5:58pm
6
local ContentProvider = game:GetService("ContentProvider")
local Images = {
"rbxassetid://9751412256",
"rbxassetid://9751413232",
"rbxassetid://9751414842",
"rbxassetid://9751415443"
}
ContentProvider:PreloadAsync(Images)
script.Parent.MouseButton1Click:Connect(function()
script.Parent.Parent.Visible = false
script.Parent.Parent.Parent.Elevator.Visible = true
script.Parent.Parent.Parent.Elevator:TweenSize(UDim2.new(1,0,1,0), Enum.EasingDirection.In, Enum.EasingStyle.Quad, 0.7)
local SurfaceGUIiguess = script.Parent.Parent.Parent.Elevator.ElevatorDoor
task.wait(0.7)
for i, v in pairs(Images) do
SurfaceGUIiguess.Image = v
task.wait(1)
end
end)
1 Like
RMofSBI
(RMofSBI)
May 28, 2022, 5:58pm
7
You have the Elevator visible, but not the image button ElevatorDoor visible, and thats where the image is.
ElevatorDoor.Visible
needs to be true as well.
but only the elevator is invisible the contents are visible
and it still doesn’t wanna work
RMofSBI
(RMofSBI)
May 28, 2022, 6:05pm
10
Can we see a snapshot of the hierarchy in explorer?
RMofSBI
(RMofSBI)
May 28, 2022, 6:09pm
12
The label shows up but not the image in the label?
Elevator Frame is showing and everything else in it also is showing only the problem is that it doesn’t load the image i guess?
RMofSBI
(RMofSBI)
May 28, 2022, 6:18pm
14
Only way i got it to show for me was to use ImageButton instead of ImageLabel.
even when i make an imagebutton it still doesn’t show
ok nevermind i fixed it by applying the image on a imagelabel and copying the id from there!
RMofSBI
(RMofSBI)
May 28, 2022, 7:25pm
17
Isn’t that this then suggested by @Motofied ?
he didn’t say to apply the image and copy the id from it