Script not being able to access BoolValue in tool

local Full
game.ReplicatedStorage.Tools.BucketEvents.WaterFilling.OnServerEvent:Connect(function(player,Content)
	Full = player.Character:FindFirstChild("Bucket").Water.Value
	print(tostring(Full))
	if Full == false then

	local Item = player.Character.Bucket.BucketItem
		if Item.Value == "Flour" then
			Full = true
		Item.Value = "BreadDough"
		Content.Transparency = 0
		Content.Material = Enum.Material.Mud
		Content.Color = Color3.new(0.92549, 0.682353, 0.435294)
	
		else
			Full = true
		Content.Transparency = 0.35
		Content.Material = Enum.Material.Glass
		Content.Color = Color3.new(0, 0.682353, 1)
		Item.Value = "Water"
		end
		end
end)

This script is supposed to handle filling a bucket with water. When it is full, it’s supposed to set the Water BoolValue to true, but it stays false, causing the BreadDough section to be overrun and replaced with water. The tool is a server-side object, so it is able to access it, however it doesn’t change to value at all. Why?

just do Full = player.Character:FindFirstChild("Bucket").Water

1 Like

A boolValue is an instance, with a property, Value, which stores the actual value, doing this just returns the instance, not the Value OP is trying to find.

Are you sure you are setting the Value property to true on the server and client side, and not just the client side.

Should be both, since this is a server script
Edit: Checked it and it is changed on both client and server

1 Like

Yeah, but when do you change player.Character:FindFirstChild("Bucket").Water.Value to true, in a server script?

Full = true, now Full.Value = true

1 Like

Okay that makes a lot more sense, I was misunderstanding the code, my bad!

2 Likes

bro i thought you were on smth for a second. or you were just trolling

1 Like

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