LocalScript printing blank on StringValue

local Content = script.Parent.Handle.Content
local Full = script.Parent.Water.Value
local Item = game.ReplicatedStorage.Tools.BucketItem.Value
print(Item.Parent)
script.Parent.Parent.Humanoid.Swimming:Connect(function()
	print(Item)
	--if not Full then
		
		--if Item == "Flour" then
		--	Item = "BreadDough"
			--Content.Transparency = 0
			--Content.Material = Enum.Material.Mud
			--Content.Color = Color3.new(0.92549, 0.682353, 0.435294)
			--Full = true
	--	else
		--	Content.Transparency = 0.35
		--	Content.Material = Enum.Material.Glass
--	Content.Color = Color3.new(0, 0.682353, 1)
--		Full = true
--		Item = "Water"
--		end
--		end
end)

Item is a StringValue in ReplicatedStorage. When checking the Explorer, the value of it is “Flour”, but when the player starts swimming and that print message fires, it’s blank. print(Item.Parent) prints nil as well if that’s important.

The “Value” is a StringValue as you specified in the title. I am pretty sure that it would error if you are trying to index a string value with parent.

Remove the print(Item.Parent) line. Then you can do the following:

local bucketItem = game:GetService("ReplicatedStorage").Tools.BucketItem

script.Parent.Parent.Humanoid.Swimming:Connect(function()
    print(bucketItem.Value)
end)
1 Like

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