It's not making the number of the GUi go up
local Player = script.Parent.Parent
local mouse = Player:GetMouse()
function Dig()
if mouse.Target.Name == "Nope" then
script.Parent.Disabled = true
end
if mouse.Target ~= nil then
if mouse.Target.Name == "Dirt" then
mouse.Target.Transparency = mouse.Target.Transparency +1
if mouse.Target.Transparency > 0.9 then
mouse.Target:remove()
script.Parent.Parent.PlayerGui.ScreenGui.Frame.Dirt.Value.Value = script.Parent.Parent.PlayerGui.ScreenGui.Frame.Dirt.Value.Value +1
end
end
if mouse.Target.Name == "Silver" then
mouse.Target.Transparency = mouse.Target.Transparency +0.5
if mouse.Target.Transparency > 0.9 then
mouse.Target:remove()
script.Parent.Parent.PlayerGui.ScreenGui.Frame.Silver.Value.Value = script.Parent.Parent.PlayerGui.ScreenGui.Frame.Silver.Value.Value +1
end
end
if mouse.Target.Name == "Diamond" then
mouse.Target.Transparency = mouse.Target.Transparency +0.3
if mouse.Target.Transparency > 0.9 then
mouse.Target:remove()
script.Parent.Parent.PlayerGui.ScreenGui.Frame.Diamond.Value.Value = script.Parent.Parent.PlayerGui.ScreenGui.Frame.Diamond.Value.Value +1
end
end
if mouse.Target.Name == "Ruby" then
mouse.Target.Transparency = mouse.Target.Transparency +0.2
if mouse.Target.Transparency > 0.9 then
mouse.Target:remove()
script.Parent.Parent.PlayerGui.ScreenGui.Frame.Ruby.Value.Value = script.Parent.Parent.PlayerGui.ScreenGui.Frame.Ruby.Value.Value +1
end
end
if mouse.Target.Name == "Emerald" then
mouse.Target.Transparency = mouse.Target.Transparency +0.16
if mouse.Target.Transparency > 0.9 then
mouse.Target:remove()
script.Parent.Parent.PlayerGui.ScreenGui.Frame.Emerald.Value.Value = script.Parent.Parent.PlayerGui.ScreenGui.Frame.Emerald.Value.Value +1
end
end
if mouse.Target.Name == "Gold" then
mouse.Target.Transparency = mouse.Target.Transparency +0.01
if mouse.Target.Transparency > 0.9 then
mouse.Target:remove()
script.Parent.Parent.PlayerGui.ScreenGui.Frame.Gold.Value.Value = script.Parent.Parent.PlayerGui.ScreenGui.Frame.Gold.Value.Value +1
end
end
end
end
mouse.Button1Down:connect(Dig)

1 comment
The number won't go up even though the GUi is connect to the Value