The computer screen doesn't show an image when seated

When I sit on the chair, the computer screen doesn’t display any image. If I manually set the image in the ImageLabel properties, it displays normally. How can I fix this?

Video

Explorer

Script
local Chair = script.Parent:WaitForChild("Seat")
local Computer = game.Workspace:WaitForChild("Computer")
local ImageLabel = Computer.Screen.SurfaceGui:WaitForChild("ImageLabel")

local Images = {
	"rbxassetid://131011668280440",
	"rbxassetid://16821012448",
}

ImageLabel.Visible = false

Chair:GetPropertyChangedSignal("Occupant"):Connect(function()
	if Chair.Occupant then
		ImageLabel.Image = Images[math.random(#Images)]
		ImageLabel.Visible = true
	else
		ImageLabel.Visible = false
	end
end)

Thank you

2 Likes
Chair:GetPropertyChangedSignal("Occupant"):Connect(function()
	print("Occupant changed:", Chair.Occupant)
	if Chair.Occupant then
		ImageLabel.Image = Images[math.random(#Images)]
		ImageLabel.Visible = true
	else
		ImageLabel.Visible = false
	end
end)

Try this and tell me what happens

1 Like

The Output shows like this.

1 Like

Check ImageLabel’s properties in Explorer

  • ImageTransparency is set to 1
  • Size is {0,0},{0,0} or otherwise zero
  • It’s positioned off-screen
  • Another GUI element is covering it (check ZIndex)
  • SurfaceGui’s Enabled property is false
  • SurfaceGui.Face is pointing away from where you’re looking

And try this:

Chair:GetPropertyChangedSignal("Occupant"):Connect(function()
	if Chair.Occupant then
		local chosen = Images[math.random(#Images)]
		print("Setting image to:", chosen)
		ImageLabel.Image = chosen
		ImageLabel.Visible = true
	else
		ImageLabel.Visible = false
	end
end)
1 Like

The image is not showing, but I’m not sure if the Properties are set correctly. I’ll send both the SurfaceGui and ImageLabel.

SurfaceGui

ImageLabel

Output

Okay, hmm. If you dont mind could you share the game file?

1 Like

Here you go

Simulator (Test).rbxl (83.9 KB)

1 Like

What the . . . I can’t get any images or anything. Nothing looks wrong. Maybe this is a bug? I tried testing to see if the images even work with just a part, and changing the image every 2 seconds, and it does not work. I have no idea.

1 Like

What should I do now? Should I report this in the Bug Reports category?

Im going to try a little bit more. I will respond in a little.

1 Like

@vision_O1 Got it.

Okay, so when I go in testing mode you can manually set the image property, and when you hit enter it gives you a different id then the one you put it. (Dont ask me why)
image
But then you copy that id and put it in your script:

local Chair = script.Parent:WaitForChild("Seat")
local Computer = game.Workspace:WaitForChild("Computer")
local ImageLabel = Computer.Screen.SurfaceGui:WaitForChild("ImageLabel")

local Images = {
	"rbxassetid://119334272549292",
}

ImageLabel.Visible = false

Chair:GetPropertyChangedSignal("Occupant"):Connect(function()
	if Chair.Occupant then
		ImageLabel.Image = Images[math.random(#Images)]
		ImageLabel.Visible = true
	else
		ImageLabel.Visible = false
	end
end)

And it works!
Simulator (Test).rbxl (74.9 KB)

1 Like

Thank you for fixing it. I will test it again.

Edit: It works. Thank you so much.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.