How can I fix this script so it changes a ImageLabel inside an overhead BillboardGui

Ok so, what I am trying to do is make it so when you click a TextButton, It changes an ImageLabel ID inside of the BillboardGui that appears above the player. That same BillboardGui also has a TextLabel in it that shows the players name.

I’ve tried changing around a few things by looking at the Output, but I don’t know what to do now. The output says “LocalPlayer is not a valid member of DataModel “GAME NAME”” and I don’t really know how to fix that.

I’ve looked for solutions in a lot of places but none of them actually fix my problem

local BillboardGui = game.LocalPlayer.BillboardGui
local ImageLabel = BillboardGui.ImageLabel

script.Parent.MouseButton1Click:Connect(function()
	ImageLabel.Image = 8989779741
end)

The script is inside of the TextButton that I am clicking, Which is inside of a frame in a ScreenGui with roughly 10 other frames

Where is the BillBoardGui located?

It’s inside of StarterCharacterScripts

ImageLabel.Image = "rbxassetid://8989779741"

Still says the exact same error

Didn’t even notice your error, I just read the thread’s title and responded.

game.LocalPlayer is not valid.

You likely meant to use game.Players.LocalPlayer instead.

1 Like

I would recommend creating a image button and then putting the ID into there, then put it inside of the script and see if it works.

Now it says “BillboardGui is not a valid member of Player “Players.ArikRulez””

Where is the BillboardGui located?

It’s located in StarterCharacterScripts and then gets inserted into the model of the player

local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local BillboardGui = Character:WaitForChild("BillboardGui")
local ImageLabel = BillboardGui:WaitForChild("ImageLabel")
local TextButton = script.Parent

TextButton.MouseButton1Click:Connect(function()
	ImageLabel.Image = "rbxassetid://8989779741"
end)

This is working on my end.

1 Like

Just ran into a bit of a predicament, is there a way for the changes to show up for other people and not just the person picking them?