Unable to assign property Value. string expected, got boolean

  1. What do you want to achieve? Keep it simple and clear!

i was following a round system tutorial by reactive metal and i got an error about the string value

  1. What is the issue? Include screenshots / videos if possible!

Unable to assign property value. string expected, got boolean.
i couldnt find a way to fix it, the 2 script is down below

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

i have try looking for solutions but i havent got an answer on what
i did wrong.

Server Script :

local intermission = 10
local roundLength = 15

--Values
local inRound = game.ReplicatedStorage.InRound
local status = game.ReplicatedStorage.Status

inRound.Changed:Connect(function()
	
	if inRound.Value == true then
		
		for i, plr in pairs(game.Players:GetPlayers()) do
			
			local char = plr.character
			local humanRoot = char:WaitForChild("HumanoidRootPart")
			
			humanRoot.CFrame = game.Workspace.MapSpawn.CFrame
			
		end 
		
	else
		
		for i, plr in pairs(game.Players:GetPlayers()) do

			local char = plr.character
			local humanRoot = char:WaitForChild("HumanoidRootPart")

			humanRoot.CFrame = game.Workspace.Lobbyspawn.CFrame

		end
		
		
	end
end)


local function round()
	while true do
		
		inRound.Value = false
		
		
		for i = intermission, 0, -1 do
			
			status.Value = "Game Starting In "..i.." Seconds"
			
			wait(1)
			
		end
		
		inRound.Value = true
		
		for i = roundLength, 0, -1 do

			status.Value = "Game Ending In "..i.." Seconds"

			wait(1)
		end
	end
end

spawn(round)

Local Script :

local textLabel = script.Parent

game.ReplicatedStorage.Status.Changed:Connect(function()
	textLabel.Text = game.ReplicatedStorage.Status.Value
end)

Your inRound value is probably a StringValue when you presumably want it to be a BoolValue.

2 Likes

What Exactly are your Values? are they a StringValue? BoolValue?

By the Looks for it, it should be fine, It seems to be an Issue with your Instances

inround and status is a string value, but the tutorial said it needs a string value nothing said about boolValue

Your issue would be that you’re trying to set a StringValue’s Value to false, a BoolValue can only be set to true or false – if you wanted to still use a StringValue, you’d have to set inRound.Value to ‘false’ and inRound.Value to ‘true’ respectively. :slight_smile:

thanks sorry if i said it unrespectfull, i was just in a rush

Oh no, no. By respectively, I meant on the 2 lines you had for setting the value to true / false :slight_smile:

No worries, glad to help!

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