Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Updating GUI without resetting character?

Asked by
J_98482 18
5 years ago
Edited 5 years ago

I'm trying to get one of my GUI elements to display a number counter, but the number itself won't update unless the player character dies or is reset. I've tried having disabling the GUI and re-enabling right after, but that didn't seem to help. What can I use to have the GUI update the value without forcing the player to reset their character? Thanks in advance to anyone who helps out. Edit: Here's what I have code-wise. It's not much, but it's all I have for now. the 'update' local is pointing to a RemoteEvent that should have, in theory, forced the GUI to update. The 'number' value is also working correctly.

local player = game.Players.LocalPlayer
local number = game.ServerStorage.credits[tostring(player.Name)]Value
local update = game.ReplicatedStorage.creditupdate


update.OnClientEvent:Connect(function()
    script.Parent.Text = "You currently have "..number
end)

0
I assume the value you are changing is on the server, in that case you can use a remote event to send the value to the client for updating ForeverBrown 356 — 5y
0
Can you post any code you have related to this ForeverBrown 356 — 5y
0
When asking a question, press the lua button or whatever and it will pop up a bunch of ~'s. Put the code in there for us to see and look at. Knineteen19 307 — 5y
0
If you did that, I could probably help you. Knineteen19 307 — 5y
View all comments (2 more)
0
^That LisaF854 93 — 5y
0
All right, I've editted the post to include what little code I have J_98482 18 — 5y

Answer this question