BoolValue in model settings problem

As part of the action in my game a coroutine is used to do some action and once completed sets a boolValue to true via InvokeServer. The function that initiated the coroutine is waiting for the boolValue to be set to true and is looping.
The specific client code for within the cooroutine is

SetBotValue:InvokeServer(ActivePlayer,Bot.Name,"DigEnded",true)

and the waiting function

		print("coroutine status",coroutine.status(Bot0Dig)," tag=",Bot.DigEnded.Value,".")
		while (Bot.DigEnded.Value == false) do
			wait()
			print("waiting tag=",Bot.DigEnded.Value,". coroutine status",coroutine.status(Bot0Dig))
		end

and the server

local function OnSetBotValue(player,SetPlayer,BotName,ValueName,Value)
	print("SetBotValue ",player,SetPlayer,BotName,ValueName,Value)
	local SetBot
	if BotName == "BotMaster" then
		SetBot = SetPlayer.Controller.Handle.BotMaster
	else
		SetBot = SetPlayer.Controller.Handle.BotMaster:FindFirstChild(BotName)
	end
	if SetBot ~= nil then
		local target = SetBot:FindFirstChild(ValueName)
--		print("target FullName",target:GetFullName())
		if target ~= nil then
			target.Value = Value
		else
			print("SetBotValue target ",ValueName," notfound")
		end
	else
		print("SetBotValue SetBot ",BotName," notfound")
	end
end

The client and server outputs and boolValue properties can be seen in the screen shots here.
Client View

And Server View

So my question is why can’t the client see what the server can.

Okay, this may be your problem. (I’m not professional, and I don’t know a lot.) But, Where you have “DigEnded”,true) I believe it needs to be:

SetBotValue:InvokeServer(ActivePlayer,Bot.Name,“DigEnded”) = true.

Remember, I am not professional. But it would help if I knew the games output.

The code statement contains an InvokeServer so its not an assignment.
The actual assignment is done in the SetBotValue function on the server in line
target.Value = Value

OK, no explanation received so my work around for this specific problem is to use another InvokeServer to get the value.
Code for that is

local function OnGetBotValue(player,SetPlayer,BotName,ValueName)
	print("GetBotValue ",player,SetPlayer,BotName,ValueName)
	local SetBot
	if BotName == "BotMaster" then
		SetBot = SetPlayer.Controller.Handle.BotMaster
	else
		SetBot = SetPlayer.Controller.Handle.BotMaster:FindFirstChild(BotName)
	end
	if SetBot ~= nil then
		local target = SetBot:FindFirstChild(ValueName)
--		print("target FullName",target:GetFullName())
		if target ~= nil then
			return target.Value
		else
			print("GetBotValue target ",ValueName," notfound")
		end
	else
		print("GetBotValue SetBot ",BotName," notfound")
	end
end

and the wait loop code is

		local BotEnded = GetBotValue:InvokeServer(ActivePlayer,"BotMaster","DigEnded")
		while (BotEnded == false) do
			wait()
			BotEnded = GetBotValue:InvokeServer(ActivePlayer,"BotMaster","DigEnded")
			print("waiting tag=",Bot.DigEnded.Value,".",BotEnded)
		end

I would still like to know why I had to do this as I thought that anything in the game.Workspace changed on the server by a server script is view-able by all the clients.

You are sending off 4 values while the server is expecting to recieve 5. When it’s BotName you’re actually getting “DigEnded”.

I thought that the player was inserted automatically when using InvokeServer.

I don’t know how are you invoking it prior to the InvokeServer so I assumed you’ve seperated that prior, also I’m not sure what is ActivePlayer/SetPlayer is supposed to be so I assumed that it was what you intented it to be.

Either way I think you need a better way to replicate data over using roblox BoolValues since they are very old.

The ActivePlayer is the player in Workspace that has the same name as the local player in Players.
The SetPlayer is the name of the player that is the parent of the object under which the Value item, whose name is in ValueName, is to be set.
The information at the top of this topic was supposed to show that the BoolValue that is being checked for completion of a task in the client is showing true in the server and false in the client.
My work round is to use a get InvokeServer to return the value from the players area BoolValue instead of just using the object path to the same item and its Value.

Have you made sure that there is nothing else changing that? It could be that another script is overriding that value locally.

The screen shots showed the value on the server and at the same time the client print repeating the value in the loop as seen by the count to the right of the print.
The screen shots were take as near as possible at the same time.
I am sure that I could reproduce the condition and probably video it so both server and client could be seen at the exact same time but I don’t see the value of that.
There is only one player and one so no other scripts running at that time.
The server is waiting and the client is in a loop.

Okay that’s pretty weird, but I still stand by my point that you should just use a data inside the script and have it send off updates to the client and vice versa over relying on boolvalues, numbervalues, etc.

Ok, at last, found my cause.
I had one instance of a Bot.DevEnded.Value = false in the main localscript.
Which, as I now know, did not update the value on the server, Later in the coroutine created by that script a set of the Value using InvokeServer was run. Meanwhile in the other localscript which was looking for the Value, this time from the server, it did not find the value that I thought had been set so the loop continued.
My ‘fix’ was to replace the last of my direct value setting to instead use the InvokeServer and now all of it works ok.
Ss part of my debugging I made a video to help myself so I could see frame by frame what was going on on the server and the client at the same time.
That trick will be in my toolkit for debugging from now on.