Walkspeed not changing in playtests despite print output saying otherwise?

I have a script that essentially shrinks the player in size and grows them for an indefinite amount of time (just experimenting around in studio) and have noticed that when I have my script attempt to change the humanoid’s WalkSpeed value, it fails completely but does not spew out any errors/warns in the output. I tried to see what’s wrong by printing the value change in the output for every while true do cycle and I get this:

image

It appears that it is modifying a “phantom” WalkSpeed value rather than modifying the already existing one and is preventing intended changes.

Code in question:

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		local noid = char:FindFirstChild("Humanoid")
		if noid ~= nil then
			
			wait(0.1)
			local HS = noid.HeadScale
			local BDS = noid.BodyDepthScale
			local BWS = noid.BodyWidthScale
			local BHS = noid.BodyHeightScale
			local WS = noid.WalkSpeed
			print("check")
		
			HS.Value = HS.Value * 0.1
			BDS.Value = BDS.Value * 0.1
			BWS.Value = BWS.Value * 0.1
			BHS.Value = BHS.Value * 0.1
			WS = WS * 0.1
			while true do
				wait(0.1)
				HS.Value = HS.Value * 1.01
				BDS.Value = BDS.Value * 1.01
				BWS.Value = BWS.Value * 1.01
				BHS.Value = BHS.Value * 1.01
				WS = WS * 1.01
				print("Walkspeed: "..WS)
			end
		end
	end)
end)

The script is a regular one existent in the game’s workspace. I’ve tried restarting Studio but this didn’t help. I’m probably incorrect on this (on the notion that this might be a bug) and that I’m just making one of those typical mistakes I make. I would like to ask for help on solving this problem.

The player’s WalkSpeed is being stored in the WS variable, and that is what you are changing.
You need to change the actual walk speed of the player, not the variable.

Adding on: to fix this issue, add this line before your print statement:

noid.WalkSpeed = WS