TextLabel.Text won't change by anything trought script

This is probally gonna sound Unusual or maybe dumb. But mine TextLabel is not wanting to change trought script.

  1. Well I really tryed of everything, checking if the code’s running with print or even changing it to Other places and redoing it to find the odd’s.

Mine script is about when a player clicks a button displaying a car, (Using Viewportframe) it goes to a global Gui where it will display the Car Values in certain gui’s. ( The car values are a table with Subtables inside made in a module script) This is rather to find efficiency and probally make less lag that if i was making for each Buttons a gui, and I’m now on the part where i globally show all the values but now Im checking if the table can be portable in the text.

One thing that was also happening is that the function dont rather activate or show a signal that it is working, from now im just want to see if i can change the text trough script since the most simple:


CarName.Text = "Audi Quattro Sport"

Is not even functioning!

I just want to know why it inst working :pensive:

  1. Well I kinda don’t see where the problem is because… It’s really unknow for me as an Early scripter.

Here’s some photo to maybe clarify it:

2020-12-31 (3)_LI

And here’s the script with the Code. I just want to know why it inst working

-- Services

local TweenService = game:GetService("TweenService")
local Players = game:GetService("Players")
local localplayer = Players.LocalPlayer
local Servertorage = game:GetService("ServerStorage")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local CoreGui = game:GetService("CoreGui")
local StarterGui = game:GetService("StarterGui")

-- Main Variables

local GameImage = StarterGui:WaitForChild("ScreenGui"):WaitForChild("GameImage")
local Store = GameImage:WaitForChild("StoreBttn")
local AppearStore = GameImage:WaitForChild("StoreAppear")
local CmDlPr = AppearStore:WaitForChild("CMdlPr")
local InRes = ReplicatedStorage:WaitForChild("WhatinThe")
local Databs = require(game:GetService("ReplicatedStorage").TableOfValues)

-- Inside Variables

local PreviewCar = CmDlPr:WaitForChild("GlobalCarPreview")

local Buy = CmDlPr:WaitForChild("BuyBttn")

local Carname = CmDlPr:WaitForChild("CarName")
local Carprice = CmDlPr:WaitForChild("CarPrice")

-- Functions

local function InResponseD()
local copy = Databs
for i, v in ipairs(copy) do
Carname.Text = tostring(copy["Audi Quattro Sport"])
Carprice.Text = tostring(copy["Audi Quattro Sport"]["Price"])
print("did it go")
       end
end

InResponseD()
  1. I tryed using the print function, looking into Roblox Developer Api Reference and Roblox Forum (Here), youtube tutorials but Now that im able to post, here it goes.
1 Like

The only thing I see is

Carname.Text = copy["Audi Quattro Sport"]
Carprice.Text = copy["Audi Quattro Sport"]["Price"]

This confused me as the first one will likely send a table, while the second one would be a value in that table., Can you show the module script so I can see what it is

Here


local DataTableCars = {
	["Renault Clio V6"] = {
		["Price"] = 2300;
	};
	["Audi Quattro Sport"] = {
		["Price"] = 4000
	}
}

return DataTableCars

This is a module script that im using.

Ok then the first value the car name won’t be sending a string but rather a table causing it to not change

To fix this you could just remove the copy part and just have it as the name of the car in a string

Carname.Text = "Audi Quattro Sport"

Tested it today and it still doesnt work oof… :worried:

(Sorry that i cant like its because I reached the maximum of likes)

Nothing appeared, actually does the ZIndex make something different for Gui’s?

Actually after i putted the ToString it dint appear any table error since it changed the name to a string in result for making the name.

There is the problem of you using starter gui, this will only ever adjust a gui that is seen after resetting.

Instead

local GameImage = localplayer:WaitForChild("PlayerGui"):WaitForChild("ScreenGui").GameImage

Also bleupigs is right as you shouldn’t need so many waitforchild s
In this script only the gameimage should ever need a wait for child

if you really want edit starter gui in case like they die or something you should add starter gui variables for it and at the function change both gui and starter gui.

Sorry this took me so long to find I hadn’t been able to look because of new years stuff

1 Like

I think Ima get more careful with Starter Gui since im having alot of problems with it. Thank you for reminding me of that! Sum cookies :cookie: :cookie: