im trying to make a custom proximity prompt but my button wont work at all. im trying to get it to print something when i clicked / tapped.
function module.PromptVisibility(p)
local function claimTree(p)
print("tree was claimed by: "..p.Name.."!")
end
for _, tree in pairs(tree_folder:GetChildren()) do
if tree:IsA("BasePart") then
if tree:FindFirstChild("claim_UI") then
local claim_UI = tree:WaitForChild("claim_UI")
local claim_frame = claim_UI:WaitForChild("claim_frame")
local control_button:TextButton = claim_frame:WaitForChild("control_button")
for _, prompt in pairs(tree:GetChildren()) do
if prompt:IsA("ProximityPrompt") then
prompt.PromptShown:Connect(function()
claim_frame.Visible = true
end)
prompt.PromptHidden:Connect(function()
claim_frame.Visible = false
end)
control_button.InputBegan:Connect(function(inp)
if inp.UserInputType == Enum.UserInputType.MouseButton1 or Enum.UserInputType.Touch then
claimTree(p)
end
end)
end
end
end
end
end
end