im having trouble picking up an item in roblox studio, when i click the object, it causes the user to fly or levitate... here s my code
local FrenchFries = script.Parent
local click = FrenchFries.ClickDetector
local function pickup(player)
local newTool = Instance.new('Tool')
newTool.Name = 'FrenchFries'
local handle = FrenchFries:Clone()
handle.Name = 'Handle'
handle.Parent = newTool
handle.Script:Destroy()
newTool.Parent = game.Workspace:FindFirstChild(player.Name)
end
click.MouseClick:Connect(pickup)`
im expecting the item to be picked up and held`
Unanchor the tool or it's parts and add wields to the object and the tool so they don't just fall. The issue was that you have the tool or one of it's parts anchored which places the object to where it was when you put it in workspace and send the player there. Some objects in Roblox, you can't unanchor them like a script.