Value not being updated

So I’ve been trying to take the value from a number and string that are located inside of a clone. They aren’t updating to the one in replicated storage.
What am I doing wrong?

local games = game.ServerStorage.minigames:GetChildren()
local minitime = game.ReplicatedStorage.minitime.Value
local mininame = game.ReplicatedStorage.mininame.Value
startre = game.ReplicatedStorage.Start
stopre = game.ReplicatedStorage.Stop


local function start()
	
local mgame = games[math.random(#games)]
	
local gameclone = mgame:Clone()
	
	gameclone.Parent = workspace
	
	print(mgame)
	
	minitime = gameclone.Time.Value --This is the time thing
	mininame = gameclone.Name --This is the Name thing
	
	task.wait(.5)
	for _, plr in pairs(game.Players:GetChildren()) do
	plr.Character.HumanoidRootPart.CFrame = workspace["tp part"].CFrame

	end
	
	local function stop()
		gameclone:Destroy()
		for _, plr in pairs(game.Players:GetChildren()) do
		plr:LoadCharacter()
		end

	end
	stopre.OnServerEvent:Connect(stop)
end

startre.OnServerEvent:Connect(start)
1 Like

you have referred to Value of the objects which returns an string or int and not an object.
Instead refer to only the object and use .Value = over here

your script is similar to

local minitime = 5
local mininame = "Hey"

local function start()
----
mintime = 15
mininame = "Hey"
----
end
Start()

try the below script, it should work fine

Script
local games = game.ServerStorage.minigames:GetChildren()
local minitime = game.ReplicatedStorage.minitime
local mininame = game.ReplicatedStorage.mininame
startre = game.ReplicatedStorage.Start
stopre = game.ReplicatedStorage.Stop


local function start()
	
local mgame = games[math.random(#games)]
	
local gameclone = mgame:Clone()
	
	gameclone.Parent = workspace
	
	print(mgame)
	
	minitime.Value = gameclone.Time.Value --This is the time thing
	mininame.Value = gameclone.Name --This is the Name thing
	
	task.wait(.5)
	for _, plr in pairs(game.Players:GetChildren()) do
	plr.Character.HumanoidRootPart.CFrame = workspace["tp part"].CFrame

	end
	
	local function stop()
		gameclone:Destroy()
		for _, plr in pairs(game.Players:GetChildren()) do
		plr:LoadCharacter()
		end

	end
	stopre.OnServerEvent:Connect(stop)
end

startre.OnServerEvent:Connect(start)
1 Like

It still isn’t updating the value in replicated storage, any help?

1 Like

try debugging using a print statement after updating the values
ex, try

minitime.Value = gameclone.Time.Value --This is the time thing
mininame.Value = gameclone.Name --This is the Name thing
print(minitime.Value, mininameValue, gameclone.Time.Value , gameclone.Name)

and let me know if it prints the correct values…

1 Like

So the value prints fine, but the problem is that it isn’t updating on the gui.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.