Localscript runs/prints fine but no properties is changed

What is the issue?
I’m working on a systems UI/Client sided interaction. Was working on a simple UI frame display on button press but came across this issue that I’ve never really quite encountered without an easy fix or small mistake. Been scripting for 3+ years.

Issue:
Localscript is running without issue and prints that the “Frame.Visible” property is true when its not changing. Same goes with changing elements such as text within the frame. It runs fine but doesn’t actually change.

What solutions have you tried so far?
The script is a localscript located in StarterPlayerScripts. Detection and other tweens work but changing the clients UI does not. I ensured the ui instances are the correct ones, printed the ClassName, tried :WaitForChild etc. Everything “acts” as normal but no properties can be changed from the script. The UI is located in PlayerGui and properly referenced. The variable is not being changed or redefined anywhere after being referenced initially.
There is also no other external scripts that has anything to do with this/changing properties

Here is the relevant code:

local PlayerGui = player:WaitForChild("PlayerGui")
local BankUI = PlayerGui:WaitForChild("BankUI")
local CheckFrame = BankUI:WaitForChild("CheckFrame")

local function ButtonPressed(Button)
		local Type = Button:GetAttribute("Type")

		if Type == "Deposit" then
            -- None of these are actually changing in Explorer
			Date.Text = os.date("%b %d")
			Name.Text = player.DisplayName
			Memo.Text = "Deposit"
			
			print(CheckFrame.ClassName) -- Prints the correct instance
			CheckFrame.Visible = true -- Actual property is not changing
			print("Visiblity set to: ",CheckFrame.Visible) -- Prints "true"
		end

I also tried running a :GetPropertyChangedSignal() but it didn’t even run so it’s not being changed at all or overidden etc. Super strange issue, previously I’ve been able to solve it quickly but this is something else. Mabey something to do with the location of the script I have no idea. Is starterplayerscripts not a valid parent folder?

From a quick glance, I’d assume its probably waiting for the PlayerGui/BankUI/CheckFrame - sounds dumb but have you made sure its in there?

I’ve checked the PlayerGui in game, yes. It is there. Also performed checks to ensure they are actually being found and are the correct instances like mentioned above. :slight_smile:

Strange - would it be possible for you to change the location of the script? For example placing it under a relevant component. Since your function is related to buttons, maybe try moving the logic to a LocalScript under the relevant button and see if that makes a difference.

Double-check you’re referencing the correct CheckFrame by printing:

print("CheckFrame:", CheckFrame:GetFullName())

After everything that has been said the issue is likely an incorrect CheckFrame issue.

It litteraly prints,

CheckFrame: Players.Vzlor.PlayerGui.BankUI.CheckFrame

There is no other CheckFrame or frame inside that BankUI its imposible its referencing something else

I just fixed it by litteraly moving the localscript to StarterGui. Appearantly its not possible to change UI elements from StarterPlayerScripts. Oh well.

Notes:

  • You don’t need to WaitForChild more than once
  • Add yield to WaitForChild to avoid memory problems
  • Make sure you use local script and not server script with local run context
  • Make sure your script is in correct place where it can work
  • Try using test script that will change Visible property of given frame

Also it’s important if you look from server view or client view in explorer, cuz it matters a lot

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