My Value is not being found, but the QiEXP is an IntValue...?

Basically, I’m trying to make my progression bar go up progressively, but it’s not really working out?

task.wait(5)

-- \\ Player-Related Variables // --

local Player = game.Players.LocalPlayer
local Stuff = Player:WaitForChild("YourInnerSelf")
local QI = Stuff:FindFirstChild("QiEXP")
local QiReq = Stuff:FindFirstChild("QiNeeded")

-- \\ GUI-Related Variables // --

local ProBar = script.Parent.ProgressionBar.ActualMovingBar

local QiCHANGER = QI.Value/100

-- \\ Functions // --

QI.Changed:Connect(function()
	ProBar:TweenSize(UDim2.new(QiCHANGER,0,0.654,0),"Out","Quint",0.25)
end)-- This is a local script!

	local leaderstats = Instance.new("Folder", Player)
	leaderstats.Name = "YourInnerSelf"

	local Neigong = Instance.new("Folder", leaderstats)
	Neigong.Name = "Neigong"
	
	local Strength = Instance.new("IntValue", Neigong)
	Strength.Name = "Strength"
	Strength.Value = 1

	QiGong = Instance.new("Folder", leaderstats)
	QiGong.Name = "Qigong"
	
	local Qi = Instance.new("IntValue", QiGong)	
	Qi.Name = "Qi"
	Qi.Value = 1
	
	QiEXP = Instance.new("IntValue", QiGong)
	QiEXP.Name = "QiEXP"
	QiEXP.Value = 0
	
	local QiNeeded = Instance.new("IntValue", QiGong)
	QiNeeded.Name = "QiNeeded"
	QiNeeded.Value = Qi.Value * 10
	
	SkillPoints = Instance.new("IntValue", leaderstats)
	SkillPoints.Name = "SP"
	SkillPoints.Value = 0


	local data

	local success, err = pcall(function()

		data = Murim:GetAsync(Player.UserId)

	end)

	if success and data then

		Neigong.Value = data[1]
		QiGong.Value = data[2]

	else
		print("The Player has no data!")
	end

end)

--This is a Server-Script!

So, the issue is really confusing me.

Back to the easier issues.

Your server script is good, it’s just that you’re using FindFirstChild in your local script which immediately checks if there is that child and returns nil if it can’t find it. You should instead use WaitForChild, which waits until the child loads in.

Local Script:

--//Services
local Players = game:GetService("Players")

--//Variables
local LocalPlayer = Players.LocalPlayer
local YourInnerSelf = LocalPlayer:WaitForChild("YourInnerSelf")
local QI = YourInnerSelf:WaitForChild("QiEXP")
local QiReq = YourInnerSelf:WaitForChild("QiNeeded")
local ProgressBar = script.Parent.ProgressionBar.ActualMovingBar

--//Controls
local QiCHANGER = QI.Value/100

--//Functions
QI:GetPropertyChangedSignal("Value"):Connect(function()
	ProgressBar:TweenSize(UDim2.new(QiCHANGER, 0, 0.654, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quint, 0.25)
end)
1 Like

well the issue is

--//Services
local Players = game:GetService("Players")

--//Variables
local LocalPlayer = Players.LocalPlayer
local YourInnerSelf = LocalPlayer:FindFirstChild("YourInnerSelf")
local QI = YourInnerSelf:FindFirstChild("QiEXP")
local QiReq = YourInnerSelf:FindFirstChild("QiNeeded")
local ProgressBar = script.Parent.ProgressionBar.ActualMovingBar

--//Controls
local QiCHANGER = QI.Value/100

--//Functions
QI:GetPropertyChangedSignal("Value"):Connect(function()
	ProgressBar:TweenSize(UDim2.new(QiCHANGER, 0, 0.654, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quint, 0.25)
	
	if QI == QiReq then
		ProgressBar:TweenSize(UDim2.new(0.049, 0, 0.654, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Back, 0.25)
	end
end)


Yeah… I don’t really know?

I said to use WaitForChild, not FindFirstChild. Just copy my code, don’t change it.

Oh, sorry. Although, the issue becomes this, and the bar still doesn’t move up.

Wait, I think it’s because you don’t create YourInnerSelf in the server script, could you send me the entire server script and I could fix it.

local RS = game:GetService("ReplicatedStorage")

local Players = game:GetService("Players")


game.Players.PlayerAdded:Connect(function(Player)
	Player.CharacterAdded:Connect(function(Character)
		task.wait()
		Character.Parent = workspace.LivingThings
		
		_G.Blocking = Instance.new("BoolValue", Character.Humanoid)
		_G.Blocking.Name = "IsBlocking"
		_G.Blocking.Value = false
		
		_G.CanAttack = Instance.new("BoolValue", Character.Humanoid)
		_G.CanAttack.Name = "CanAttack"
		_G.CanAttack.Value = false
		
		_G.Running = Instance.new("BoolValue", Character.Humanoid)
		_G.Running.Name = "Running"
		_G.Running.Value = false
		
		_G.ClashChance = Instance.new("IntValue", Character.Humanoid)
		_G.ClashChance.Name = "Clash"
		_G.ClashChance.Value = nil
		
		_G.Clashing = Instance.new("BoolValue", Character.Humanoid)
		_G.Clashing.Name = "Clashing"
		_G.Clashing.Value = false
		
		_G.CanAdd = Instance.new("IntValue", Character.Humanoid)
		_G.CanAdd.Name = "CanAdd"
		_G.CanAdd.Value = nil
		
		_G.Parry = Instance.new("BoolValue", Character.Humanoid)
		_G.Parry.Name = "Parry"
		_G.Parry.Value = false
		
		local Jeh = Enum.HumanoidHealthDisplayType.AlwaysOff == true
	end)
end)

local DataStoreService = game:GetService("DataStoreService")
local Murim = DataStoreService:GetDataStore("MurimWorld")

local function SaveData(Player)

	local TableCreation = 
		{
			Player.YourInnerSelf.Neigong.Folder,
			Player.YourInnerSelf.Qigong.Folder,

			Player.YourInnerSelf.Neigong.Folder.Strength,
			Player.YourInnerSelf.Neigong.Folder.Endurance,
			Player.YourInnerSelf.Neigong.Folder.Speed,
		}

	local PRID = "Player_"..Player.UserID



	local success, err = pcall(function()
		Murim:SetAsync(Player.UserID, TableCreation)
	end)

	if success then
		print("Data has been saved!")
	else
		print("Data hasn't been saved!")
		warn(err)
	end
end

local function CheckifSaved(Player)
	SaveData(Player)
end

game.Players.PlayerRemoving:Connect(CheckifSaved)

game:BindToClose(function()
	for _, player in pairs(game.Players:GetPlayers()) do
		SaveData(player)
	end
end)

game.Players.PlayerAdded:Connect(function(Player)

	local leaderstats = Instance.new("Folder", Player)
	leaderstats.Name = "YourInnerSelf"



	local NeigongEXP = Instance.new("IntValue", leaderstats)
	NeigongEXP.Name = "NeigongEXP"
	NeigongEXP.Value = 0

	local Neigong = Instance.new("Folder", leaderstats)
	Neigong.Name = "Neigong"
	Neigong.Value = 1

	local NeigongLevelNeeded = Instance.new("IntValue", leaderstats)
	NeigongLevelNeeded.Value = Neigong.Value * 100
	NeigongLevelNeeded.Name = "NeigongLevelNeeded"

	QiGongExp = Instance.new("IntValue", leaderstats)
	QiGongExp.Name = "QigongEXP"
	QiGongExp.Value = 0

	QiGong = Instance.new("Folder", leaderstats)
	QiGong.Name = "Qigong"
	QiGong.Value = 0

	QiGongLevelNeeded = Instance.new("IntValue", leaderstats)
	QiGongLevelNeeded.Value = QiGong.Value * 100
	QiGongLevelNeeded.Name = "QiLevelNeeded"

	SkillPoints = Instance.new("IntValue", leaderstats)
	SkillPoints.Name = "SP"
	SkillPoints.Value = 0

	local CultivationMethod = Instance.new("StringValue", QiGong)




	local data

	local success, err = pcall(function()

		data = Murim:GetAsync(Player.UserId)

	end)

	if success and data then

		Neigong.Value = data[1]
		QiGong.Value = data[2]

	else
		print("The Player has no data!")
	end

end)

RS.Progressing.OnServerEvent:Connect(function(Player, Statement)

	local Character = Player.Character
	local OutaBodyStats = Player:WaitForChild("YourInnerSelf").Neigong
	local Qi = Player:WaitForChild("YourInnerSelf").Qigong
	if Statement == "MeditationTraining" then
		print("Shh")
		QiGongExp.Value += 1
	end

	QiGongExp.Changed:Connect(function()
		if QiGongExp.Value >= QiGongLevelNeeded.Value then
			QiGongExp.Value = 0

			SkillPoints.Value += 1

			QiGong.Value += 1
			QiGongLevelNeeded.Value = QiGong.Value * 100


		end
	end)
end)

This warning is fairly self-explanatory, from the client’s perspective an instance named “YourInnerSelf” does not exist.

How would I fix such a thing then? Doing meditation on the server instead?

Add timeout in :WaitForChild because infinite yield possible means it’s taking too long it stopped waiting. So if you use a timeout after that timeout it will stopped waiting.

Like:

:WaitForChild("Instance",60)

The second parameter is the timeout.
As you can see i out 60, meaning after 60s it will stopped waiting for the object.

That’s kind of reversed because server are the one that can’t see the client’s perspective. But the client can see the server perspective. (But not the changes on the module as i tried that before)

Hard to understand what you’re trying to convey but the warning is occurring from a local script which means that for the particular client of which the local script is executing for, an instance named “YourInnerSelf” doesn’t exist.

The error still stays, even doing this.

--//Services
local Players = game:GetService("Players")

--//Variables
local LocalPlayer = Players.LocalPlayer
local YourInnerSelf = LocalPlayer:WaitForChild("YourInnerSelf", 60)
local QI = YourInnerSelf:WaitForChild("QiEXP", 60)
local QiReq = YourInnerSelf:WaitForChild("QiNeeded", 60)
local ProgressBar = script.Parent.ProgressionBar.ActualMovingBar

--//Controls
local QiCHANGER = QI.Value/100

--//Functions
QI:GetPropertyChangedSignal("Value"):Connect(function()
	ProgressBar:TweenSize(UDim2.new(QiCHANGER, 0, 0.654, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quint, 0.25)
	
	if QI == QiReq then
		ProgressBar:TweenSize(UDim2.new(0.049, 0, 0.654, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Back, 0.25)
	end
end)

Alright, I fixed the part where it couldn’t find the Values, but now? The bar doesn’t even increase. So, I don’t know what to do right now.