Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to connect a value and textbox?

Hi, I'm working on a game currently, and I'm trying to make a timer gui. Changing the text directly just makes it reset when a player dies, and won't match up if another player joins the game.

I thought of connecting it to a StringValue, but I'm not totally sure how to do this.

I'm fairly new to Lua, any advice?

2 comments

0

"Changing the text directly just makes it reset when a player dies" Sounds like you're altering the StarterGui not the PlayerGui elements. "and won't match up if another player joins the game." And it sounds like you're looping through players first then looping through their time. "I thought of connecting it to a StringValue" Use a number value, change that value with the script,

0

In the Gui script, just listen to the Changed event. Anyway, we can't completely help you unless you show us your attempt.

1 answer

✓ Accepted answer

Simply run a for loop in a script in Workspace to update everyone's timer when it counts down. This way you don't even need an IntValue.

for x = 10,1,-1 do
	for i,v in pairs(game.Players:GetPlayers()) do
		v.PlayerGui.ScreenGui.TextLabel.Text = tostring(x)
	end
	wait(1)
end

This discussion is preserved as it was. New answers, comments, and votes are closed.