End Goal
Alright so basicially I want to create a system where when I touch a block called WaterSource with my bucket, the bucket fills up with water(not terrain water) I then want it to when the bucket is filled up, when I stand over another block called DirtPatch, it will turn the dirt a darker color and empty the bucket, giving it the effect that I watered the dirt. I would also like to be able to pour the water into a Mortar&Pestle along with some wheat, to give me bread.
So what is the issue?
Well I am having some trouble with the Mortar system… You see I want it so when you are holding out the bucket of water and it has water in it, then I want every proximpty prompt to be enabled(I want this to happen to everything named Mortar&Pestle, without me having to manually do it for every Mortar. The next thing is obviously the bucket is a tool, so when I actually empty the water into the Mortar I don’t know a way of telling the Tool script that their is no more water.
Conclusion
I don’t have a problem with my code or anything, no errors I simply just don’t know how to go about doing this.
I’m not sure what this means. Could you rephrase it?
You could have a BoolValue in the bucket called “Water,” and when you empty the bucket, make it equal to false and have the actual water in the bucket disappear (become transparent). Then when you refill the bucket, make it equal to true again and the water in the bucket become visible again.
You could mark every proximityprompt named “Mortar” with collectionservice at the start of the game:
local CS = game:GetService("CollectionService")
for i,v in ipairs(workspace:GetDescendants()) do
if v:IsA("ProximityPrompt") and v.Name == "Mortar" then
CS:AddTag(v,"MortarPrompt")
end
end
For enabling proximity prompts, you could just run this function in a localscript to toggle the prompts on or off:
function togglePrompts()
for i,v in ipairs(CS:GetTagged("MortarPrompt")) do
v.Enabled = (not v.Enabled)
end
end
To determine if there’s water in bucket, you could just create a boolvalue within the tool, and set it to either true or false depending on whether or not the bucket has been emptied.