I used a script and wanted to make it so it shows text and updates it based on the part’s name, but it doesn’t seem to be working.
local plr = game.Players.LocalPlayer
local mouse = plr:GetMouse()
local values = game.StarterGui.PartValues
mouse.Move:Connect(function()
local target = mouse.Target
for _,blocks in pairs(workspace.Blocks:GetChildren()) do
if target == blocks then
values.Id.TextTransparency = 0
values.Id.PartName.Text = target.Name
else
values.Id.TextTransparency = 1
end
end
end)
This script is meant to make the text “id:” show with TextTransparency and then update the PartName TextLabel by getting the target name. Then if not selected, it keeps both TextLabels hidden.
local plr = game.Players.LocalPlayer
local mouse = plr:GetMouse()
local values = game.StarterGui.PartValues
mouse.Move:Connect(function()
local target = mouse.Target
for _,blocks in pairs(workspace.Blocks:GetDescendants()) do
if target == blocks then
values.Id.TextTransparency = 0
values.Id.PartName.Text = target.Name
else
values.Id.TextTransparency = 1
end
end
end)
mouse.Target could be a child of a model which is not what workspace.Blocks:GetChildren() gets
I forgot that you can’t change the GUI by addressing it “game.StarterGui.PartValues” because game.StarterGui is just a folder that clone its descendants into player’s gui which means changing anything in this folder is basically useless.
Instead try :
local values = plr.PlayerGui.PartValues
You can only change GUI that inside Player Gui to make the changes visible to player, otherwise it will not.