Datastore2 Text wont update

hello !
i actually want to make a system where when the player click on a button, a textbox update with a text inside. And i dont know it dont work :confused:
	local location = DataStore2("location", player)

local script

local label = script.Parent

local replicatedStorage = game:GetService("ReplicatedStorage")

label.Text = lieu


What does this have to do with DataStore2?

Also could you please be a bit specific with the titles and what you need then we can help you!

1 Like

because later i need this values. ( and yes sure )

local Players = game:GetService("Players")
local ServerScriptService = game:GetService("ServerScriptService")
local Workspace = game:GetService("Workspace")
local replicatedStorage = game:GetService("ReplicatedStorage")

local DataStore2 = require(ServerScriptService.DataStore2)
local defaultEndurance = 20
local defaultValue = 50
local defualtXpValue = 1
local defaultValueLevel = 1
local defaultValueEndurance = 20
local defaultLocation = "Land"
local lieu1 = "Arestia"
--local button = game.StarterGui.Main.TextButton

	local enduranceStack = DataStore2("endurance", player)
	local currencyStore = DataStore2("currency", player)
	local actualLevel = DataStore2("level", player)
	local actualXp = DataStore2("xp", player)
	local location = DataStore2("location", player)
	local function updateClientLocation(lieu),lieu)

and this script is the script for the button


local button = script.Parent

--local location = button.ImageLabel

local PLACE1 = button.Parent.PLACE1

local PLACE2 = button.Parent.PLACE2

local PLACE3 = button.Parent.PLACE3

local PLACE4 = button.Parent.PLACE4

local PLACE1_IN = button.Parent.PLACE1_IN

local returnButton = button.Parent.returnButton

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local lieuRemote =

local map1 =

local button_map1 = PLACE1_IN.ImageButton

local frame_map1 = PLACE1_IN.Frame



-- if location.Visible == false then

-- location.Visible = true

-- end



-- if location.Visible == true then

-- location.Visible = false

-- end




PLACE1.Visible = false

PLACE2.Visible = false

PLACE3.Visible = false

PLACE4.Visible = false

PLACE1_IN.Visible = true

returnButton.Visible = true

map1.Visible = false

button_map1.Visible = true

frame_map1.Visible = true


I can vaguely make something for you:

local trigger = script.Parent
local boxtoupd  = script.Parent.Parent.BoxToUpdate
local text = "Your text goes here"

boxtoupd.Text = text

As I just saw your recent post I know this wont help much but I just wanted to point it out.

1 Like

oh okay! its a smart idea ! thx a lot i think it work. but with this system, i cant save it right ?

You welcome, well you can save it if you change the values, but I, personally, have never used Datastore2 before.
You can try this:

Be sure to solution this if its solved so other people dont need to come here even though its solved!

1 Like

yes sure thx you a lot ! it help me a lot

Also this should help too!

You welcome, dm me if you have any other questions!

1 Like