#Text Not Updating

16 messages · Page 1 of 1 (latest)

candid horizon
#

When I try to set the text it is not working, It should update every 0.1 seconds but it looks like it only updates once that that's it. Any other info needed please tell me.

Setting Adding

local point = game.Workspace.Point
local pointMulti = game.Workspace.PointMulti
local pointAdd = game.Workspace.PointAdd

point.Value = 0
pointMulti.Value = 1
pointAdd.Value = 0

local function add()
    while true do
        wait(1)
        point.Value += pointAdd.Value
        print("after adding, points is now at")
        print(point.Value)
    end
end

task.spawn(add)

local textBox = game.StarterGui.ScreenGui.Point

local function setText()
    while true do
        wait(0.1)
        textBox.Text = tostring(point.Value)
        print("set the text to:")
        print(point.Value)
    end
end

task.spawn(setText)

Click Logic

local clickDetector = script.Parent
local pointAdd = game.Workspace.PointAdd

local function onClicked(player)
    pointAdd.Value += 1
    print(pointAdd.Value)
end

clickDetector.MouseClick:Connect(onClicked)
prime narwhalBOT
#

studio** You are now Level 2! **studio

exotic ice
#

it looks like your trying to change the number of a gui with a server script

#

you should put the textbox changing code in a local script in starterplayerscripts

#

so like:

#

Local Script (in starterplayerscripts, or the gui)

local textBox = game.StarterGui.ScreenGui.Point
local point = game.Workspace.Point

local function setText()
    while true do
        wait(0.1)
        textBox.Text = tostring(point.Value)
        print("set the text to:")
        print(point.Value)
    end
end```
#

remove the task.spawns from the setting adding and remove the old text gui code

candid horizon
#

I moved it into a new localscript and made it work, no errors but it now dosnt even update. (put in StarterPlayerScripts)

#

trying to put it in GUI rn

exotic ice
#

remove the settext function

#

so

#
local textBox = game.StarterGui.ScreenGui.Point
local point = game.Workspace.Point

while wait(0.1) do
    textBox.Text = tostring(point.Value)
    print("set the text to:")
    print(point.Value)
end
candid horizon
#

IT WORKED

#

tytytyty

#

<3