https://gyazo.com/ef379282dc78f734e5f8064e0af4e862 Here's a example, I want the 0 to be a IntValue, lets say when someone hits a tree the value goes up by 1, how could I make it show up in the GUI? Is there a way to change the Text via IntValues?
Thanks for any help!
Basically from what I understood you want a script that increases the value of an IntValue by one every time you touch a part (in this case a tree). All you have to do is make a function that increases the value of the IntValue by one and has a loop that changes the text of the Gui to the value of the IntValue.
Example:
local treePart = workspace.TreePart -- Whatever this might be local textLabel = ScreenGui.TextLabel -- Whatever this textlabel is local intValue = workspace.IntValue -- Whatever this intvalue is treePart.Touched:connect(function() intValue.Value = intValue.Value + 1 -- increases the value of the int value by 1 end) while wait() do textLabel.Text = tostring(intValue.Value) -- changes the text of the TextLabel continuously end
I hope this helps!
Hello sir, from what i understand you are trying to update the text of the UI every time your integer value changes right? In this case you will need "value.Changed" and function for example:
local val = --your int value here local text = --your TextLabel.Text here local function updateText() text = ""..val end value.Changed:Connect(updateText) -- this line will run the function every time your value changes.
Warning! this is just example you will probably need to edit the script to make it work for your game :)