--creates bottle up on click mousedown = false part = script.Parent starteddown= 0 local player = game.Players.LocalPlayer local mouse = player:GetMouse() mouse.Button1Down:connect(function() mousedown = true while mousedown == true do part.Anchored = true part.Position = part.Position + Vector3.new(0,0.3, 0) print("Button one down") wait() end end) mouse.Button1Up:connect(function() mousedown = false script.Parent.Anchored = false end) --need to create down motion --checks if hit local part3 = game.Workspace.BOTTLE.Union part3.Parent.Touched:connect(function(hit) local find = hit.Parent:FindFirstChild("top") if find ~= nil then part3.Anchored = true else part3.Anchored = false end end)
No errors pop up in the output, the bottle just doesnt leave the table when the mouse is held down
Ok here you go:
ply = game.Players.LocalPlayer mouse = ply:GetMouse() go = false function Up() game.Workspace.Part.Anchored = true game.Workspace.Part.CFrame = game.Workspace.Part.CFrame * CFrame.new(0,0.3,0) end while true do mouse.Button1Down:connect(function() go = true end) mouse.Button1Up:connect(function() go = false game.Workspace.Part.Anchored = false end) if go == true then Up() else game.Workspace.Part.Anchored = false end wait(0.1) end
Just replace part's directory with script.Parent.