I made a sword by using a hopperbin and pressing the 'e' button makes the hopperbin drop at where the mouse is, i was wondering about how i could limit the furthest point it can be dropped to WITHOUT stopping the drop action. Basicly, i still want it to drop in the same direction but i only want it to drop (let's say) 5 studs far from the player. How can i accomplish this?
mouse.KeyDown:connect(function(key) key = string.lower(key) if key == "e" and holding then --holding is a value that's equal to true if the hopperbin is selected Delete() --Deletes the parts of the sword from the character FixArm() --This is supposed to remove the weld that's holding the right arm, but it makes it fall in online mode :c tool.Parent = workspace tool.Active = false if (char.Torso.CFrame.p - mouse.Hit.p).magnitude > dropdistance then --dropdistance == 5 model._Handle.CFrame = mouse.Hit * CFrame.new(0,5,0) end end end) --NOTE: the sword model inside the character is a clone of the actual model inside the hopperbin, so i delete the clone one and put the real one into the workspace. The idea is that you can take and drop weapons.