@@The-Scary-Gamer You would have to add a variable into the tool that keeps track of how many times it has been clicked. So using the script from the video, that would look something like this: --//Variables local tool = script.Parent.Parent --Variable for the tool local clickdetector = tool.ClickDetector --Variable for the click detector local pickupLimit = 2 -- Maximum number of pickups allowed local pickupCount = 0 -- Counter for the number of times the tool has been picked up --//Pick up clickdetector.MouseClick:Connect(function(player) --When the click detector is clicked if pickupCount < pickupLimit then local char = player.Character --Variable for the player's character if not char:FindFirstChild(tool.Name) then --Check for tool inside character if not player.Backpack:FindFirstChild(tool.Name) then --Check for tool inside character's backpack local newtool = tool:Clone() --IF checks passed then clone the tool newtool:WaitForChild("ClickDetector"):Destroy() --Destroy the click detector in the new tool newtool.Parent = player.Backpack --Put tool inside the player's backpack pickupCount = pickupCount + 1 -- Increment the counter end end else clickdetector:Destroy() -- Destroy the click detector to prevent further pickups end end) Just make sure to change the limit to what you want!
Nice video tysm! but I'm having a problem that every time I want to click my new tool in my backpack, the new tool overlap with the original one on the ground, and my character instantly teleport to where it is. Do you know how to fix this?
Im having an issue where players are able to kick around the object and move it, do you have any fixes? That is the only issue EDIT: so far the only solution I've came across is putting small invisible rings around the object to prevent in from moving, and still being able to pick it up. Although I would still prefer to find another way around this.
@@TheGibusPan try to anchor the tool but not the handle. If that doesn't work, anchor the handle too, but when you collect the tool, make sure through the code you set the cloned tool's handle's anchor to false
@@onfirerobloxscripting Thank you, but I have already found another solution, which is to make a model of the tool, that gives you the tool when clicked. But I will try that in the future to save time.
I don't think you can have both, because the drag detector would override the click detector. There is however, a .MouseClick function on drag detectors, which would make it function the same as a click detector. The only issue with that is if the player starts to drag something with the drag detector, when they are done, it will fire the .MouseClick function