Connect the button event to a function which equips/dequips the model by placing it in your character and welding it. Then, you can use the UserInputService to detect mouse clicks and whatnot.
Here's a rough skeleton to get you started. Note that this won't work for filtering enabled games.
function equipTool()
tool = toolModel:Clone()
tool.Parent = character
end
function dequipTool()
tool:Destroy()
end
button.MouseButton1Click:connect(function()
if equipped then
equipTool()
else
unequipTool()
end
end)
game:GetService("UserInputService").InputBegan:Connect(function(input)
if input.UserInputType == "MouseButton1" then
end
end)
2 comments
Explique moi en français ce que tu veux faire et je te répondrais ce que je sais
Ce n'est pas un site de demande. De plus, expliquez en détail ce que vous essayez de faire.