How can I do a variable for a button

How can I do a Variable for a TextButton which is stored in the StarterGui.TradeGui and it’s not the script Parent It’s in a different ScreenGui as the Script(I just need the Variable btw. this is the script if you need it:

local frame = script.Parent
local plr = game.Players.LocalPlayer
local clickSound = frame.clickSound
local chosenSound = frame.chosenRoleSound
local roleText = frame.role
local remote = game.ReplicatedStorage:WaitForChild(“DisplayRole”)

frame.Visible = false

remote.OnClientEvent:Connect(function()

frame.Visible = true
frame:TweenPosition(UDim2.new(0.5,0,0,8,0), Enum.EasingDirection.Out, Enum.EasingStyle.Sine, 0.3, false)

local chosenRole = plr:WaitForChild("Role").Value

local possibleRoles = {

["Murderer"] = {textColor = Color3.fromRGB(255, 11, 0)},
["Innocent"] = {textColor = Color3.fromRGB(0, 255, 2)}

}

local maxLoops = 10
local currentLoops = 0

while true do
	currentLoops+= 1
	for roleName, Role in pairs(possibleRoles) do
		roleText.Text = roleName
		roleText.TextColor3 = Role.textColor
		local clickSoundClone = clickSound:Clone()
		clickSoundClone.Parent = clickSound.Parent
		clickSoundClone:Play()
		wait(.1)
		clickSoundClone:Destroy()
		
	end
	if currentLoops >= maxLoops then
		roleText.Text = chosenRole
		roleText.TextColor3 = possibleRoles[chosenRole].textColor
		chosenSound:play()
		break
	end
end

	frame:TweenPosition(UDim2.new(0.5,0,0,8,0), Enum.EasingDirection.Out, Enum.EasingStyle.Sine, 0.3, false)

end)

Where is it located in the explorer? (send a screenshot)

local var = game.Players.LocalPlayer.PlayerGui.TradeGui:WaitForChild(“Button name here”)

This is assuming if the button you are mentioning is directly under TradeGui.

The reason I did not use StarterGui is because once the game runs, you would want the client’s current GUI, not the GUI in StarterGui.