This is the script:
local prox = script.Parent local tools = { ["Tool_1"] = 5, ["Tool_2"] = 10, ["Tool_3"] = 100 }
prox.Triggered:Connect(function(player)
local tool = player.Character:FindFirstChildWhichIsA("Tool").Name
if table.find(tools, tool) then
player.leaderstats.Money.Value += table.find(tools, tool)
print(tool)
end
end)
The Problem is that it doesn’t give me the money or it doesn’t print in the if table.find(tools, tool) then if I add this line:
elseif not table.find(tools, tool) then print("Not Tool")
It prints Not Tool