Not sure if this is the exact problem going on here so I’m assuming, but I’m having trouble with my script not retrieving the updated values (of a StringValue, BoolValue, and IntValue) of a tool.
I have a “Bucket” tool stored in StarterPack, and the child values (Filled, LiquidType, Uses) that get updated when the player fills the bucket with water, etc. And I have a ProximityPrompt assigned to a part that should print the current updated values of the Bucket tool, but keeps showing the default values instead.
local placeholder = script.Parent
local pp = placeholder:WaitForChild("ProximityPrompt")
pp.Triggered:Connect(function(plr)
local backpack = plr:FindFirstChild("Backpack")
local char = plr.Character or plr.CharacterAdded:Wait()
local bucket = nil
if backpack then
bucket = backpack:FindFirstChild("Bucket")
end
if not bucket and char then
bucket = char:FindFirstChild("Bucket")
end
if not bucket then
bucket = plr:FindFirstChild("Bucket")
end
if bucket then
print("Parent: ", bucket.Parent)
local filled = bucket:FindFirstChild("Filled")
local liquidType = bucket:FindFirstChild("LiquidType")
local uses = bucket:FindFirstChild("Uses")
if filled and liquidType and uses then
print("Filled:", filled.Value)
print("LiquidType:", liquidType.Value)
print("Uses:", uses.Value)
end
end
end)
And in the Output, after getting water, it shows:
21:47:47.444 bucket has water - Client - LocalScript:27
21:47:49.477 Parent: ADreadful_Reality - Server - Script:23
21:47:49.479 Filled: false - Server - Script:30
21:47:49.479 LiquidType: - Server - Script:31
21:47:49.479 Uses: 3 - Server - Script:32
The values should show “Filled: true”, “LiquidType: water”, and “Uses: 3” (didn’t script this one yet), but they keep displaying the default values instead.
Also while testing the game, under the player and their backpack, the tool’s values are updated to what they are supposed to be.