I’m trying to edit the text of a screen GUI inside of my PlayerGui when I activate a proximity prompt. When I use the prompt, nothing happens, I’ve printed stuff from it fine, it’s like it just ignores the line that edits the Gui. I’ve used the same line in the command bar (substituting “plr” with “game.Players.Infernecrosis”) and it works fine. Trying this line outside of the function also works fine.
script.Parent.Triggered:Connect(function(plr)
script.Parent.Parent.Transparency = 1
script.Parent.Enabled = false
if tonumber(plr.PlayerGui.hunger.TextLabel.Text) <= 80 then
plr.PlayerGui.hunger.TextLabel.Text = plr.PlayerGui.hunger.TextLabel.Text + 20
else
plr.PlayerGui.hunger.TextLabel.Text = "100"
end
task.wait(180)
script.Parent.Parent.Transparency = 0
script.Parent.Enabled = true
end)
Thanks for the response. I tried using a local script for it, but it still has the exact same problem. Also, are you sure I can’t change the player’s GUI for a server script? Because I used the same line outside of the function, and it was able to modify it.
What is the original text of the TextLabel? is it “100”? if so, does the TextLabel ever go below 80? Also, UI elements ARE modifiable by the server AND they replicate to the client.