Text not changing from a script

I’m trying to change the text of a TextBox in a specific player, however, the text isn’t changing at all for some reason. Any help would be appreciated.

The script is below. (This is a server script inside of ServerScriptService)

moderator is an instance (being the player who fired the event which the code below is inside of). And yes, the ModPanel gui does exist and when in-game, it is on my screen. The code below does run, but it doesn’t do anything. No errors is in the output.

moderator:FindFirstChild("PlayerGui"):FindFirstChild("ModPanel").Main.Panel.ScrollingFrame.PlayerToBan.Text = ""
moderator:FindFirstChild("PlayerGui"):FindFirstChild("ModPanel").Main.Panel.ScrollingFrame.PlayerToBan.PlaceholderText = "Invalid player!"
wait(2)
moderator:FindFirstChild("PlayerGui"):FindFirstChild("ModPanel").Main.Panel.ScrollingFrame.PlayerToBan.PlaceholderText = "Player to ban"

Use a localscript and change the :FindFirstChild to :WaitForChild

Works, but I was trying to do it a different way. Thanks though.

Make sure you are correctly referencing the gui you want to change.

I was, I double checked multiple times.

so what was the problem
???

Just that the text wouldn’t change.

np bro anytime :slight_smile: :slight_smile: