I have:
script.Parent.Touched:connect(function(h)
[script]
end)
And i need this function could use h
player.PlayerGui.Gui.Button.MouseButton1Down:connect(function()
[script]
Part.Parent = h
end)
It should look like this:
script.Parent.Touched:connect(function(h)
if h.Name == "Test" then
player.PlayerGui.Gui.Button.Visible = true
end)
player.PlayerGui.Gui.Button.MouseButton1Down:connect(function()
local att = Instance.new("Attachment")
att.Parent = h
end)
But "MouseButton1Down:connect" function don't know what is h

1 comment
Probably
holdH = hshould be inside theifstatement and the MouseButton1Down connection should not be inside the script.Parent.Touched connection (or else you'll end up with many connections). Finally, use "Connect" not "connect". Nonetheless, the right idea, +1